\input{preamble}

% OK, start here.
%
\begin{document}

\title{More on Morphisms of Stacks}


\maketitle

\phantomsection
\label{section-phantom}

\tableofcontents

\section{Introduction}
\label{section-introduction}

\noindent
In this chapter we continue our study of properties of morphisms of algebraic
stacks. A reference in the case of quasi-separated algebraic stacks with
representable diagonal is \cite{LM-B}.




\section{Conventions and abuse of language}
\label{section-conventions}

\noindent
We continue to use the conventions and the abuse of language
introduced in
Properties of Stacks, Section \ref{stacks-properties-section-conventions}.






\section{Thickenings}
\label{section-thickenings}

\noindent
The following terminology may not be completely standard, but it is convenient.
If $\mathcal{Y}$ is a closed substack of an algebraic stack $\mathcal{X}$,
then the morphism $\mathcal{Y} \to \mathcal{X}$ is representable.

\begin{definition}
\label{definition-thickening}
Thickenings.
\begin{enumerate}
\item We say an algebraic stack $\mathcal{X}'$ is a {\it thickening}
of an algebraic stack $\mathcal{X}$ if $\mathcal{X}$ is a closed substack
of $\mathcal{X}'$ and the associated topological spaces are equal.
\item Given two thickenings $\mathcal{X} \subset \mathcal{X}'$ and
$\mathcal{Y} \subset \mathcal{Y}'$ a {\it morphism of thickenings}
is a morphism $f' : \mathcal{X}' \to \mathcal{Y}'$ of algebraic stacks
such that $f'|_\mathcal{X}$ factors through the closed
substack $\mathcal{Y}$. In this situation we set
$f = f'|_\mathcal{X} : \mathcal{X} \to \mathcal{Y}$ and we say that
$(f, f') : (\mathcal{X} \subset \mathcal{X}') \to
(\mathcal{Y} \subset \mathcal{Y}')$ is a morphism of thickenings.
\item Let $\mathcal{Z}$ be an algebraic stack. We similarly define
{\it thickenings over $\mathcal{Z}$} and
{\it morphisms of thickenings over $\mathcal{Z}$}.
This means that the algebraic stacks
$\mathcal{X}'$ and $\mathcal{Y}'$
are endowed with a structure
morphism to $\mathcal{Z}$ and that $f'$ fits into a suitable
$2$-commutative diagram of algebraic stacks.
\end{enumerate}
\end{definition}

\noindent
Let $\mathcal{X} \subset \mathcal{X}'$ be a thickening of algebraic stacks.
Let $U'$ be a scheme and let $U' \to \mathcal{X}'$ be a surjective smooth
morphism. Setting $U = \mathcal{X} \times_{\mathcal{X}'} U'$ we obtain
a morphism of thickenings
$$
(U \subset U') \longrightarrow (\mathcal{X} \subset \mathcal{X}')
$$
and $U \to \mathcal{X}$ is a surjective smooth morphism. We can often
deduce properties of the thickening $\mathcal{X} \subset \mathcal{X}'$
from the corresponding properties of the thickening $U \subset U'$.
Sometimes, by abuse of language, we say that a morphism
$\mathcal{X} \to \mathcal{X}'$ is a thickening if it is a closed
immersion inducing a bijection $|\mathcal{X}| \to |\mathcal{X}'|$.

\begin{lemma}
\label{lemma-thickening}
Let $i : \mathcal{X} \to \mathcal{X}'$ be a morphism of algebraic stacks.
The following are equivalent
\begin{enumerate}
\item $i$ is a thickening of algebraic stacks (abuse of language as above), and
\item $i$ is representable by algebraic spaces and
is a thickening in the sense of Properties of Stacks, Section
\ref{stacks-properties-section-properties-morphisms}.
\end{enumerate}
In this case $i$ is a closed immersion and a universal homeomorphism.
\end{lemma}

\begin{proof}
By More on Morphisms of Spaces, Lemmas
\ref{spaces-more-morphisms-lemma-descending-property-thickening} and
\ref{spaces-more-morphisms-lemma-base-change-thickening}
the property $P$ that a morphism of algebraic spaces is a
(first order) thickening is fpqc local on the base and stable under base
change. Thus the discussion in Properties of Stacks, Section
\ref{stacks-properties-section-properties-morphisms} indeed applies.
Having said this the equivalence of (1) and (2) follows from
the fact that $P = P_1 + P_2$ where $P_1$ is the property of being
a closed immersion and $P_2$ is the property of being surjective.
(Strictly speaking, the reader should also consult
More on Morphisms of Spaces, Definition
\ref{spaces-more-morphisms-definition-thickening},
Properties of Stacks, Definition \ref{stacks-properties-definition-immersion}
and the discussion following, Morphisms of Spaces, Lemma
\ref{spaces-morphisms-lemma-surjective-representable},
Properties of Stacks, Section \ref{stacks-properties-section-surjective}
to see that all the concepts all match up.)
The final assertion is clear from the foregoing.
\end{proof}

\noindent
We will use the lemma without further mention. Using the same references
More on Morphisms of Spaces, Lemmas
\ref{spaces-more-morphisms-lemma-descending-property-thickening} and
\ref{spaces-more-morphisms-lemma-base-change-thickening}
as used in the lemma, allows us to define a first order thickening as follows.

\begin{definition}
\label{definition-first-order-thickening}
We say an algebraic stack $\mathcal{X}'$ is a {\it first order thickening}
of an algebraic stack $\mathcal{X}$ if $\mathcal{X}$ is a closed substack
of $\mathcal{X}'$ and $\mathcal{X} \to \mathcal{X}'$ is a first order
thickening in the sense of Properties of Stacks, Section
\ref{stacks-properties-section-properties-morphisms}.
\end{definition}

\noindent
If $(U \subset U') \to (\mathcal{X} \subset \mathcal{X}')$ is a smooth
cover by a scheme as above, then this simply means that $U \subset U'$
is a first order thickening. Next we formulate the obligatory lemmas.

\begin{lemma}
\label{lemma-base-change-thickening}
Let $\mathcal{Y} \subset \mathcal{Y}'$ be a thickening of algebraic stacks.
Let $\mathcal{X}' \to \mathcal{Y}'$ be a morphism of algebraic stacks
and set $\mathcal{X} = \mathcal{Y} \times_{\mathcal{Y}'} \mathcal{X}'$.
Then
$(\mathcal{X} \subset \mathcal{X}') \to (\mathcal{Y} \subset \mathcal{Y}')$
is a morphism of thickenings. If $\mathcal{Y} \subset \mathcal{Y}'$ is a first
order thickening, then $\mathcal{X} \subset \mathcal{X}'$ is a first
order thickening.
\end{lemma}

\begin{proof}
See discussion above, Properties of Stacks, Section
\ref{stacks-properties-section-properties-morphisms}, and
More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-base-change-thickening}.
\end{proof}

\begin{lemma}
\label{lemma-composition-thickening}
If $\mathcal{X} \subset \mathcal{X}'$ and $\mathcal{X}' \subset \mathcal{X}''$
are thickenings of algebraic stacks, then so is
$\mathcal{X} \subset \mathcal{X}''$.
\end{lemma}

\begin{proof}
See discussion above, Properties of Stacks, Section
\ref{stacks-properties-section-properties-morphisms}, and
More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-composition-thickening}
\end{proof}

\begin{example}
\label{example-reduction-thickening}
Let $\mathcal{X}'$ be an algebraic stack. Then $\mathcal{X}'$ is a thickening
of the reduction $\mathcal{X}'_{red}$, see
Properties of Stacks, Definition
\ref{stacks-properties-definition-reduced-induced-stack}.
Moreover, if $\mathcal{X} \subset \mathcal{X}'$ is a thickening
of algebraic stacks, then
$\mathcal{X}'_{red} = \mathcal{X}_{red} \subset \mathcal{X}$.
In other words, $\mathcal{X} = \mathcal{X}'_{red}$ if and only
if $\mathcal{X}$ is a reduced algebraic stack.
\end{example}

\begin{lemma}
\label{lemma-reduced-diagonal}
Let $(f, f') : (\mathcal{X} \subset \mathcal{X}') \to
(\mathcal{Y} \subset \mathcal{Y}')$ be a morphism of thickenings
of algebraic stacks. Then
$\mathcal{X} \times_\mathcal{Y} \mathcal{X} \to
\mathcal{X}' \times_{\mathcal{Y}'} \mathcal{X}'$
is a thickening and the canonical diagram
$$
\xymatrix{
\mathcal{X} \ar[r]_-\Delta \ar[d] &
\mathcal{X} \times_\mathcal{Y} \mathcal{X} \ar[d] \\
\mathcal{X}' \ar[r]^-{\Delta'} &
\mathcal{X}' \times_{\mathcal{Y}'} \mathcal{X}'
}
$$
is cartesian.
\end{lemma}

\begin{proof}
Since $\mathcal{X} \to \mathcal{Y}'$ factors through the closed
substack $\mathcal{Y}$ we see that
$\mathcal{X} \times_\mathcal{Y} \mathcal{X} =
\mathcal{X} \times_{\mathcal{Y}'} \mathcal{X}$.
Hence
$\mathcal{X} \times_\mathcal{Y} \mathcal{X} \to
\mathcal{X}' \times_{\mathcal{Y}'} \mathcal{X}'$
is isomorphic to the composition
$$
\mathcal{X} \times_{\mathcal{Y}'} \mathcal{X} \to
\mathcal{X} \times_{\mathcal{Y}'} \mathcal{X}' \to
\mathcal{X}' \times_{\mathcal{Y}'} \mathcal{X}'
$$
both of which are thickenings as base changes of thickenings
(Lemma \ref{lemma-base-change-thickening}).
Hence so is the composition
(Lemma \ref{lemma-composition-thickening}).
Since $\mathcal{X} \to \mathcal{X}'$ is a monomorphism,
the final statement of the lemma follows from
Properties of Stacks, Lemma
\ref{stacks-properties-lemma-monomorphism-diagonal}
applied to $\mathcal{X} \to \mathcal{X}' \to \mathcal{Y}'$.
\end{proof}

\begin{lemma}
\label{lemma-thickening-diagonals}
Let $(f, f') : (\mathcal{X} \subset \mathcal{X}') \to
(\mathcal{Y} \subset \mathcal{Y}')$ be a morphism of thickenings
of algebraic stacks.
Let $\Delta : \mathcal{X} \to \mathcal{X} \times_\mathcal{Y} \mathcal{X}$ and
$\Delta' : \mathcal{X}' \to \mathcal{X}' \times_{\mathcal{Y}'} \mathcal{X}'$
be the corresponding diagonal morphisms.
Then each property from the following list is satisfied by $\Delta$ if
and only if it is satisfied by $\Delta'$:
(a) representable by schemes, (b) affine, (c) surjective, (d) quasi-compact,
(e) universally closed, (f) integral, (g) quasi-separated, (h) separated,
(i) universally injective, (j) universally open, (k) locally quasi-finite,
(l) finite, (m) unramified, (n) monomorphism, (o) immersion,
(p) closed immersion, and (q) proper.
\end{lemma}

\begin{proof}
Observe that
$$
(\Delta, \Delta') :
(\mathcal{X} \subset \mathcal{X}')
\longrightarrow
(\mathcal{X} \times_\mathcal{Y} \mathcal{X} \subset
\mathcal{X}' \times_{\mathcal{Y}'} \mathcal{X}')
$$
is a morphism of thickenings (Lemma \ref{lemma-reduced-diagonal}).
Moreover $\Delta$ and $\Delta'$ are
representable by algebraic spaces by
Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-properties-diagonal}.
Hence, via the discussion in
Properties of Stacks, Section
\ref{stacks-properties-section-properties-morphisms}
the lemma follows for cases (a), (b), (c), (d),
(e), (f), (g), (h), (i), and (j) by using
More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-thicken-property-morphisms}.

\medskip\noindent
Lemma \ref{lemma-reduced-diagonal} tells us that
$\mathcal{X} = (\mathcal{X} \times_\mathcal{Y} \mathcal{X})
\times_{(\mathcal{X}' \times_{\mathcal{Y}'} \mathcal{X}')} \mathcal{X}'$.
Moreover, $\Delta$ and $\Delta'$ are locally of finite type by
the aforementioned
Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-properties-diagonal}.
Hence the result for cases (k), (l), (m), (n), (o), (p), and (q) by using
More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-properties-that-extend-over-thickenings}.
\end{proof}

\noindent
As a consequence we obtain the following pleasing result.

\begin{lemma}
\label{lemma-thickening-properties}
\begin{reference}
\cite[Theorem 2.2.5]{Conrad-moduli}
\end{reference}
Let $\mathcal{X} \subset \mathcal{X}'$ be a thickening of algebraic
stacks. Then
\begin{enumerate}
\item $\mathcal{X}$ is an algebraic space if and only if $\mathcal{X}'$
is an algebraic space,
\item $\mathcal{X}$ is a scheme if and only if $\mathcal{X}'$ is a scheme,
\item $\mathcal{X}$ is DM if and only if $\mathcal{X}'$ is DM,
\item $\mathcal{X}$ is quasi-DM if and only if $\mathcal{X}'$ is quasi-DM,
\item $\mathcal{X}$ is separated if and only if $\mathcal{X}'$ is separated,
\item $\mathcal{X}$ is quasi-separated if and only if $\mathcal{X}'$ is
quasi-separated, and
\item add more here.
\end{enumerate}
\end{lemma}

\begin{proof}
In each case we reduce to a question about the diagonal and then
we use Lemma \ref{lemma-thickening-diagonals} applied to the
morphism of thickenings
$$
(\mathcal{X} \subset \mathcal{X}') \to
\left(\Spec(\mathbf{Z}) \subset \Spec(\mathbf{Z})\right)
$$
We do this after viewing
$\mathcal{X} \subset \mathcal{X}'$ as a thickening of algebraic stacks
over $\Spec(\mathbf{Z})$ via
Algebraic Stacks, Definition \ref{algebraic-definition-viewed-as}.

\medskip\noindent
Case (1). An algebraic stack is an algebraic space if and only if its
diagonal is a monomorphism, see
Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-hierarchy}
(this also follows immediately from Algebraic Stacks,
Proposition \ref{algebraic-proposition-algebraic-stack-no-automorphisms}).

\medskip\noindent
Case (2). By (1) we may assume that $\mathcal{X}$ and $\mathcal{X}'$
are algebraic spaces and then we can use
More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-thickening-scheme}.

\medskip\noindent
Case (3) -- (6). Each of these cases corresponds to a condition
on the diagonal, see Morphisms of Stacks, Definitions
\ref{stacks-morphisms-definition-separated} and
\ref{stacks-morphisms-definition-absolute-separated}.
\end{proof}









\section{Morphisms of thickenings}
\label{section-morphisms-thickenings}

\noindent
If $(f, f') : (\mathcal{X} \subset \mathcal{X}') \to
(\mathcal{Y} \subset \mathcal{Y}')$ is a morphism
of thickenings of algebraic stacks, then often properties of the morphism
$f$ are inherited by $f'$. There are several variants.

\begin{lemma}
\label{lemma-thicken-property-morphisms}
Let $(f, f') : (\mathcal{X} \subset \mathcal{X}') \to
(\mathcal{Y} \subset \mathcal{Y}')$
be a morphism of thickenings of algebraic stacks. Then
\begin{enumerate}
\item $f$ is an affine morphism if and only if $f'$ is an affine morphism,
\item $f$ is a surjective morphism if and only if $f'$ is a surjective morphism,
\item $f$ is quasi-compact if and only if $f'$ quasi-compact,
\item $f$ is universally closed if and only if $f'$ is universally closed,
\item $f$ is integral if and only if $f'$ is integral,
\item $f$ is universally injective if and only if $f'$ is universally injective,
\item $f$ is universally open if and only if $f'$ is universally open,
\item $f$ is quasi-DM if and only if $f'$ is quasi-DM,
\item $f$ is DM if and only if $f'$ is DM,
\item $f$ is (quasi-)separated if and only if $f'$ is (quasi-)separated,
\item $f$ is representable if and only if $f'$ is representable,
\item $f$ is representable by algebraic spaces if and only if $f'$ is
representable by algebraic spaces,
\item add more here.
\end{enumerate}
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-thickening} the morphisms $\mathcal{X} \to \mathcal{X}'$
and $\mathcal{Y} \to \mathcal{Y}'$ are universal homeomorphisms. Thus any
condition on $|f| : |\mathcal{X}| \to |\mathcal{Y}|$ is equivalent with
the corresponding condition on $|f'| : |\mathcal{X}'| \to |\mathcal{Y}'|$
and the same is true after arbitrary base change by a morphism
$\mathcal{Z}' \to \mathcal{Y}'$. This proves that
(2), (3), (4), (6), (7) hold.

\medskip\noindent
In cases (8), (9), (10), (12) we can translate the conditions on
$f$ and $f'$ into conditions on the diagonals $\Delta$ and $\Delta'$
as in Lemma \ref{lemma-thickening-diagonals}. See
Morphisms of Stacks, Definition \ref{stacks-morphisms-definition-separated} and
Lemma \ref{stacks-morphisms-lemma-hierarchy}.
Hence these cases follow from Lemma \ref{lemma-thickening-diagonals}.

\medskip\noindent
Proof of (11). If $f'$ is representable, then so is $f$, because
for a scheme $T$ and a morphism $T \to \mathcal{Y}$ we have
$\mathcal{X} \times_\mathcal{Y} T =
\mathcal{X} \times_{\mathcal{X}'} (\mathcal{X}' \times_{\mathcal{Y}'} T)$
and $\mathcal{X} \to \mathcal{X}'$ is a closed immersion (hence representable).
Conversely, assume $f$ is representable, and let $T' \to \mathcal{Y}'$
be a morphism where $T'$ is a scheme. Then
$$
\mathcal{X} \times_{\mathcal{Y}}
(\mathcal{Y} \times_{\mathcal{Y}'} T') =
\mathcal{X} \times_{\mathcal{X}'}
(\mathcal{X}' \times_{\mathcal{Y}'} T') \to
\mathcal{X}' \times_{\mathcal{Y}'} T'
$$
is a thickening (by Lemma \ref{lemma-base-change-thickening})
and the source is a scheme. Hence the target is a scheme by
Lemma \ref{lemma-thickening-properties}.

\medskip\noindent
In cases (1) and (5) if either $f$ or $f'$ has the stated property,
then both $f$ and $f'$ are representable by (11). In this case
choose an algebraic space $V'$ and a surjective smooth morphism
$V' \to \mathcal{Y}'$. Set $V = \mathcal{Y} \times_{\mathcal{Y}'} V'$,
$U' = \mathcal{X}' \times_{\mathcal{Y}'} V'$, and
$U = \mathcal{X} \times_{\mathcal{Y}'} V'$. Then the desired
results follow from the corresponding results for
the morphism $(U \subset U') \to (V \subset V')$ of thickenings
of algebraic spaces via the principle of Properties of Stacks, Lemma
\ref{stacks-properties-lemma-check-property-covering}.
See More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-thicken-property-morphisms}
for the corresponding results in the case of algebraic spaces.
\end{proof}





\section{Infinitesimal deformations of algebraic stacks}
\label{section-deform}

\noindent
This section is the analogue of
More on Morphisms of Spaces, Section
\ref{spaces-more-morphisms-section-deform}.

\begin{lemma}
\label{lemma-flatness-morphism-thickenings-fp-over-ft}
Consider a commutative diagram
$$
\xymatrix{
(\mathcal{X} \subset \mathcal{X}') \ar[rr]_{(f, f')} \ar[rd] & &
(\mathcal{Y} \subset \mathcal{Y}') \ar[ld] \\
& (\mathcal{B} \subset \mathcal{B}')
}
$$
of thickenings of algebraic stacks. Assume
\begin{enumerate}
\item $\mathcal{Y}' \to \mathcal{B}'$ is locally of finite type,
\item $\mathcal{X}' \to \mathcal{B}'$ is
flat and locally of finite presentation,
\item $f$ is flat, and
\item $\mathcal{X} = \mathcal{B} \times_{\mathcal{B}'} \mathcal{X}'$ and
$\mathcal{Y} = \mathcal{B} \times_{\mathcal{B}'} \mathcal{Y}'$.
\end{enumerate}
Then $f'$ is flat and for all $y' \in |\mathcal{Y}'|$ in the image of $|f'|$
the morphism $\mathcal{Y}' \to \mathcal{B}'$ is flat at $y'$.
\end{lemma}

\begin{proof}
Choose an algebraic space $U'$ and a surjective smooth morphism
$U' \to \mathcal{B}'$.
Choose an algebraic space $V'$ and a surjective smooth morphism
$V' \to U' \times_{\mathcal{B}'} \mathcal{Y}'$.
Choose an algebraic space $W'$ and a surjective smooth morphism
$W' \to V' \times_{\mathcal{Y}'} \mathcal{X}'$. Let $U, V, W$
be the base change of $U', V', W'$ by $\mathcal{B} \to \mathcal{B}'$.
Then flatness of $f'$ is equivalent to flatness of $W' \to V'$ and
we are given that $W \to V$ is flat. Hence we may apply the lemma
in the case of algebraic spaces to the diagram
$$
\xymatrix{
(W \subset W') \ar[rr] \ar[rd] & & (V \subset V') \ar[ld] \\
& (U \subset U')
}
$$
of thickenings of algebraic spaces. See
More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-flatness-morphism-thickenings-fp-over-ft}.
The statement about flatness of $\mathcal{Y}'/\mathcal{B}'$ at points in the
image of $|f'|$ follows in the same manner.
\end{proof}

\begin{lemma}
\label{lemma-deform-property-fp-over-ft}
Consider a commutative diagram
$$
\xymatrix{
(\mathcal{X} \subset \mathcal{X}') \ar[rr]_{(f, f')} \ar[rd] & &
(\mathcal{Y} \subset \mathcal{Y}') \ar[ld] \\
& (\mathcal{B} \subset \mathcal{B}')
}
$$
of thickenings of algebraic stacks.
Assume $\mathcal{Y}' \to \mathcal{B}'$ locally of finite type,
$\mathcal{X}' \to \mathcal{B}'$ flat and locally of finite presentation,
$\mathcal{X} = \mathcal{B} \times_{\mathcal{B}'} \mathcal{X}'$, and
$\mathcal{Y} = \mathcal{B} \times_{\mathcal{B}'} \mathcal{Y}'$. Then
\begin{enumerate}
\item $f$ is flat if and only if $f'$ is flat,
\label{item-flat-fp-over-ft}
\item $f$ is an isomorphism if and only if $f'$ is an isomorphism,
\label{item-isomorphism-fp-over-ft}
\item $f$ is an open immersion if and only if $f'$ is an open immersion,
\label{item-open-immersion-fp-over-ft}
\item $f$ is a monomorphism if and only if $f'$ is a monomorphism,
\label{item-monomorphism-fp-over-ft}
\item $f$ is locally quasi-finite if and only if $f'$ is locally quasi-finite,
\label{item-quasi-finite-fp-over-ft}
\item $f$ is syntomic if and only if $f'$ is syntomic,
\label{item-syntomic-fp-over-ft}
\item $f$ is smooth if and only if $f'$ is smooth,
\label{item-smooth-fp-over-ft}
\item $f$ is unramified if and only if $f'$ is unramified,
\label{item-unramified-fp-over-ft}
\item $f$ is \'etale if and only if $f'$ is \'etale,
\label{item-etale-fp-over-ft}
\item $f$ is finite if and only if $f'$ is finite, and
\label{item-finite-fp-over-ft}
\item add more here.
\end{enumerate}
\end{lemma}

\begin{proof}
In case (\ref{item-flat-fp-over-ft}) this follows from
Lemma \ref{lemma-flatness-morphism-thickenings-fp-over-ft}.

\medskip\noindent
In cases
(\ref{item-syntomic-fp-over-ft}), (\ref{item-smooth-fp-over-ft})
this can be proved by the method used in the proof of
Lemma \ref{lemma-flatness-morphism-thickenings-fp-over-ft}.
Namely, choose an algebraic space $U'$ and a surjective smooth morphism
$U' \to \mathcal{B}'$.
Choose an algebraic space $V'$ and a surjective smooth morphism
$V' \to U' \times_{\mathcal{B}'} \mathcal{Y}'$.
Choose an algebraic space $W'$ and a surjective smooth morphism
$W' \to V' \times_{\mathcal{Y}'} \mathcal{X}'$. Let $U, V, W$
be the base change of $U', V', W'$ by $\mathcal{B} \to \mathcal{B}'$.
Then the property for $f$, resp.\ $f'$
is equivalent to the property for of $W' \to V'$, resp.\ $W \to V$.
Hence we may apply the lemma in the case of algebraic spaces to the
diagram
$$
\xymatrix{
(W \subset W') \ar[rr] \ar[rd] & & (V \subset V') \ar[ld] \\
& (U \subset U')
}
$$
of thickenings of algebraic spaces. See
More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-deform-property-fp-over-ft}.

\medskip\noindent
In cases (\ref{item-unramified-fp-over-ft}) and (\ref{item-etale-fp-over-ft})
we first see that the assumption for $f$ or $f'$ implies that both
$f$ and $f'$ are DM morphisms of algebraic stacks, see
Lemma \ref{lemma-thicken-property-morphisms}. Then we can choose
an algebraic space $U'$ and a surjective smooth morphism
$U' \to \mathcal{B}'$.
Choose an algebraic space $V'$ and a surjective smooth morphism
$V' \to U' \times_{\mathcal{B}'} \mathcal{Y}'$.
Choose an algebraic space $W'$ and a surjective \'etale(!) morphism
$W' \to V' \times_{\mathcal{Y}'} \mathcal{X}'$. Let $U, V, W$
be the base change of $U', V', W'$ by $\mathcal{B} \to \mathcal{B}'$.
Then $W \to V \times_\mathcal{Y} \mathcal{X}$ is surjective
\'etale as well. Hence the property for $f$, resp.\ $f'$
is equivalent to the property for of $W' \to V'$, resp.\ $W \to V$.
Hence we may apply the lemma in the case of algebraic spaces to the
diagram
$$
\xymatrix{
(W \subset W') \ar[rr] \ar[rd] & & (V \subset V') \ar[ld] \\
& (U \subset U')
}
$$
of thickenings of algebraic spaces. See
More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-deform-property-fp-over-ft}.

\medskip\noindent
In cases (\ref{item-isomorphism-fp-over-ft}),
(\ref{item-open-immersion-fp-over-ft}),
(\ref{item-monomorphism-fp-over-ft}),
(\ref{item-finite-fp-over-ft})
we first conclude by Lemma \ref{lemma-thicken-property-morphisms}
that $f$ and $f'$ are representable by algebraic spaces. Thus we may choose
an algebraic space $U'$ and a surjective smooth morphism
$U' \to \mathcal{B}'$,
an algebraic space $V'$ and a surjective smooth morphism
$V' \to U' \times_{\mathcal{B}'} \mathcal{Y}'$, and then
$W' = V' \times_{\mathcal{Y}'} \mathcal{X}'$ will be an algebraic space.
Let $U, V, W$ be the base change of
$U', V', W'$ by $\mathcal{B} \to \mathcal{B}'$.
Then $W = V \times_\mathcal{Y} \mathcal{X}$ as well.
Then we have to see that $W' \to V'$ is an
isomorphism, resp.\ an open immersion, resp.\ a monomorphism,
resp.\ finite, if and only if $W \to V$ has the same property.
See Properties of Stacks, Lemma
\ref{stacks-properties-lemma-check-property-covering}.
Thus we conclude by applying the results
for algebraic spaces as above.

\medskip\noindent
In the case (\ref{item-quasi-finite-fp-over-ft}) we first
observe that $f$ and $f'$ are locally of finite type by
Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-finite-type-permanence}.
On the other hand, the morphism $f$ is quasi-DM if and only if
$f'$ is by
Lemma \ref{lemma-thicken-property-morphisms}.
The last thing to check to see if $f$ or $f'$ is locally quasi-finite
(Morphisms of Stacks, Definition
\ref{stacks-morphisms-definition-locally-quasi-finite})
is a condition on underlying topological spaces
which holds for $f$ if and only if it holds for $f'$ by
the discussion in the first paragraph of the proof.
\end{proof}









\section{Lifting affines}
\label{section-lifting-affines}

\noindent
Consider a solid diagram
$$
\xymatrix{
W \ar[d] \ar@{..>}[r] & W' \ar@{..>}[d] \\
\mathcal{X} \ar[r] & \mathcal{X}'
}
$$
where $\mathcal{X} \subset \mathcal{X}'$ is a thickening of algebraic stacks,
$W$ is an affine scheme and $W \to \mathcal{X}$ is smooth. The question
we address in this section is whether we can find $W'$ and the dotted
arrows so that the square is cartesian and $W' \to \mathcal{X}'$ is smooth.
We do not know the answer in general, but if $\mathcal{X} \subset \mathcal{X}'$
is a first order thickening we will prove the answer is yes.

\medskip\noindent
To study this problem we introduce the following category.

\begin{remark}[Category of lifts]
\label{remark-gerbe-of-lifts}
Consider a diagram
$$
\xymatrix{
W \ar[d]_x \\
\mathcal{X} \ar[r] & \mathcal{X}'
}
$$
where $\mathcal{X} \subset \mathcal{X}'$ is a thickening of algebraic stacks,
$W$ is an algebraic space, and $W \to \mathcal{X}$ is smooth.
We will construct a category $\mathcal{C}$ and a functor
$$
p : \mathcal{C} \longrightarrow W_{spaces, \etale}
$$
(see Properties of Spaces, Definition
\ref{spaces-properties-definition-spaces-etale-site} for notation)
as follows. An object of $\mathcal{C}$ will be a system
$(U, U', a, i, x', \alpha)$
which forms a commutative diagram
\begin{equation}
\label{equation-object}
\vcenter{
\xymatrix{
U \ar[d]_a \ar[r]_i & U' \ar[dd]^{x'} \\
W \ar[d]_x & \\
\mathcal{X} \ar[r] & \mathcal{X}'
}
}
\end{equation}
with commutativity witnessed by the $2$-morphism
$\alpha : x \circ a \to x' \circ i$ such that
$U$ and $U'$ are algebraic spaces,
$a : U \to W$ is \'etale, $x' : U' \to \mathcal{X}'$ is smooth,
and such that $U = \mathcal{X} \times_{\mathcal{X}'} U'$.
In particular $U \subset U'$ is a thickening.
A morphism
$$
(U, U', a, i, x', \alpha) \to (V, V', b, j, y', \beta)
$$
is given by $(f, f', \gamma)$ where $f : U \to V$ is a morphism
over $W$, $f' : U' \to V'$ is a morphism whose restriction
to $U$ gives $f$, and $\gamma : x' \circ f' \to y'$ is a $2$-morphism
witnessing the commutativity in right triangle of the diagram below
\begin{equation}
\label{equation-morphism}
\vcenter{
\xymatrix{
& V \ar[ld]_f \ar[ldd]^b \ar[rr]_j & & V' \ar[ld]_{f'} \ar[lddd]^{y'} \\
U \ar[d]_a \ar[rr]_i & & U' \ar[dd]_{x'} \\
W \ar[d]_x & \\
\mathcal{X} \ar[rr] & & \mathcal{X}'
}
}
\end{equation}
Finally, we require that $\gamma$ is compatible with $\alpha$ and $\beta$:
in the calculus of $2$-categories of Categories, Sections
\ref{categories-section-formal-cat-cat} and
\ref{categories-section-2-categories} this reads
$$
\beta = (\gamma \star \text{id}_j) \circ (\alpha \star \text{id}_f)
$$
(more succinctly: $\beta = j^*\gamma \circ f^*\alpha$).
Another formulation is that objects are commutative diagrams
(\ref{equation-object}) with some additional properties and
morphisms are commutative diagrams
(\ref{equation-morphism}) in the category $\textit{Spaces}/\mathcal{X}'$
introduced in Properties of Stacks, Remark
\ref{stacks-properties-remark-representable-over}.
This makes it clear that $\mathcal{C}$ is a category
and that the rule $p : \mathcal{C} \to W_{spaces, \etale}$
sending $(U, U', a, i, x', \alpha)$ to $a : U \to W$
is a functor.
\end{remark}

\begin{lemma}
\label{lemma-morphisms-lifts-etale}
For any morphism (\ref{equation-morphism}) the map $f' : V' \to U'$ is \'etale.
\end{lemma}

\begin{proof}
Namely $f : V \to U$ is \'etale as a morphism in $W_{spaces, \etale}$
and we can apply
Lemma \ref{lemma-deform-property-fp-over-ft} because $U' \to \mathcal{X}'$
and $V' \to \mathcal{X}'$ are smooth and
$U = \mathcal{X} \times_{\mathcal{X}'} U'$ and
$V = \mathcal{X} \times_{\mathcal{X}'} V'$.
\end{proof}

\begin{lemma}
\label{lemma-gerbe-of-lifts-fibred}
The category $p : \mathcal{C} \to W_{spaces, \etale}$ constructed
in Remark \ref{remark-gerbe-of-lifts} is fibred in groupoids.
\end{lemma}

\begin{proof}
We claim the fibre categories of $p$ are groupoids.
If $(f, f', \gamma')$ as in (\ref{equation-morphism})
is a morphism such that $f : U \to V$ is an isomorphism, then
$f'$ is an isomorphism by Lemma \ref{lemma-deform-property-fp-over-ft}
and hence $(f, f', \gamma')$ is an isomorphism.

\medskip\noindent
Consider a morphism $f : V \to U$ in $W_{spaces, \etale}$
and an object $\xi = (U, U', a, i, x', \alpha)$
of $\mathcal{C}$ over $U$. We are going to construct the ``pullback''
$f^*\xi$ over $V$. 
Namely, set $b = a \circ f$. Let $f' : V' \to U'$ be the \'etale morphism
whose restriction to $V$ is $f$ (More on Morphisms of Spaces,
Lemma \ref{spaces-more-morphisms-lemma-topological-invariance}).
Denote $j : V \to V'$ the corresponding thickening.
Let $y' = x' \circ f'$ and $\gamma = \text{id} : x' \circ f' \to y'$.
Set
$$
\beta = \alpha \star \text{id}_f :
x \circ b = x \circ a \circ f \to
x' \circ i \circ f = x' \circ f' \circ j = y' \circ j
$$
It is clear that $(f, f', \gamma) : (V, V', b, j, y', \beta) \to
(U, U', a, i, x', \alpha)$ is a morphism as in
(\ref{equation-morphism}). The morphisms $(f, f', \gamma)$
so constructed are strongly cartesian
(Categories, Definition \ref{categories-definition-cartesian-over-C}).
We omit the detailed proof, but essentially the reason is that
given a morphism
$(g, g', \epsilon) : (Y, Y', c, k, z', \delta) \to (U, U', a, i, x', \alpha)$
in $\mathcal{C}$ such that $g$ factors as $g = f \circ h$ for some
$h : Y \to V$, then we get a unique factorization $g' = f' \circ h'$
from More on Morphisms of Spaces,
Lemma \ref{spaces-more-morphisms-lemma-topological-invariance}
and after that one can produce the necessary $\zeta$ such that
$(h, h', \zeta) :  (Y, Y', c, k, z', \delta) \to
(V, V', b, j, y', \beta)$ is a morphism of $\mathcal{C}$
with $(g, g', \epsilon) = (f, f', \gamma) \circ (h, h', \zeta)$.

\medskip\noindent
Therefore $p : \mathcal{C} \to W_\etale$ is a fibred
category (Categories, Definition \ref{categories-definition-fibred-category}).
Combined with the fact that the fibre categories are groupoids
seen above we conclude that $p : \mathcal{C} \to W_\etale$
is fibred in groupoids by Categories, Lemma
\ref{categories-lemma-fibred-groupoids}.
\end{proof}

\begin{lemma}
\label{lemma-gerbe-of-lifts-stack}
The category $p : \mathcal{C} \to W_{spaces, \etale}$ constructed
in Remark \ref{remark-gerbe-of-lifts} is a stack in groupoids.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-gerbe-of-lifts-fibred} we see the first condition
of Stacks, Definition \ref{stacks-definition-stack-in-groupoids} holds.
As is customary we check descent of objects and we leave it to the reader
to check descent of morphisms. Thus suppose we have $a : U \to W$
in $W_{spaces, \etale}$, a covering $\{U_k \to U\}_{k \in K}$ in
$W_{spaces, \etale}$, objects $\xi_k = (U_k, U'_k, a_k, i_k, x'_k, \alpha_k)$
of $\mathcal{C}$ over $U_k$, and morphisms
$$
\varphi_{kk'} = (f_{kk'}, f'_{kk'}, \gamma_{kk'}) :
\xi_k|_{U_k \times_U U_{k'}} \to
\xi_{k'}|_{U_k \times_U U_{k'}}
$$
between restrictions satisfying the cocycle condition. In order to prove
effectivity we may first refine the covering. Hence we may assume each
$U_k$ is a scheme (even an affine scheme if you like). Let us write
$$
\xi_k|_{U_k \times_U U_{k'}} =
(U_k \times_U U_{k'}, U'_{kk'}, a_{kk'}, x'_{kk'}, \alpha_{kk'})
$$
Then we get an \'etale (by Lemma \ref{lemma-morphisms-lifts-etale}) morphism
$s_{kk'} : U'_{kk'} \to U'_k$
as the second component of the morphism
$\xi_k|_{U_k \times_U U_{k'}} \to \xi_k$ of $\mathcal{C}$.
Similarly we obtain an \'etale morphism $t_{kk'} : U'_{kk'} \to U'_{k'}$
by looking at the second component of the composition
$$
\xi_k|_{U_k \times_U U_{k'}} \xrightarrow{\varphi_{kk'}}
\xi_{k'}|_{U_k \times_U U_{k'}} \to \xi_{k'}
$$
We claim that
$$
j :
\coprod\nolimits_{(k, k') \in K \times K} U'_{kk'}
\xrightarrow{(\coprod s_{kk'}, \coprod t_{kk'})}
(\coprod\nolimits_{k \in K} U'_k) \times (\coprod\nolimits_{k \in K} U'_k)
$$
is an \'etale equivalence relation. First, we have already seen
that the components $s, t$ of the displayed morphism are \'etale.
The base change of the morphism $j$ by
$(\coprod U_k) \times (\coprod U_k) \to (\coprod U'_k) \times (\coprod U'_k)$
is a monomorphism because it is the map
$$
\coprod\nolimits_{(k, k') \in K \times K} U_k \times_U U_{k'}
\longrightarrow
(\coprod\nolimits_{k \in K} U_k) \times (\coprod\nolimits_{k \in K} U_k)
$$
Hence $j$ is a monomorphism by More on Morphisms, Lemma
\ref{more-morphisms-lemma-properties-that-extend-over-thickenings}.
Finally, symmetry of the relation $j$ comes from the fact that
$\varphi_{kk'}^{-1}$ is the ``flip'' of $\varphi_{k'k}$ (see
Stacks, Remarks \ref{stacks-remarks-definition-descent-datum})
and transitivity comes from the cocycle condition (details omitted).
Thus the quotient of $\coprod U'_k$ by $j$ is an algebraic space $U'$
(Spaces, Theorem \ref{spaces-theorem-presentation}).
Above we have already shown that there is a thickening
$i : U \to U'$ as we saw that the restriction of $j$ on
$\coprod U_k$ gives $(\coprod U_k) \times_U (\coprod U_k)$.
Finally, if we temporarily view the $1$-morphisms
$x'_k : U'_k \to \mathcal{X}'$ as objects of the stack
$\mathcal{X}'$ over $U'_k$ then we see that these come endowed with a
descent datum with respect to the \'etale covering
$\{U'_k \to U'\}$ given by the third component $\gamma_{kk'}$
of the morphisms $\varphi_{kk'}$ in $\mathcal{C}$.
Since $\mathcal{X}'$ is a stack
this descent datum is effective and translating back we obtain
a $1$-morphism $x' : U' \to \mathcal{X}'$ such that the compositions
$U'_k \to U' \to \mathcal{X}'$ come equipped with isomorphisms to $x'_k$
compatible with $\gamma_{kk'}$. This means that the morphisms
$\alpha_k : x \circ a_k \to x'_k \circ i_k$ glue to a morphism
$\alpha : x \circ a \to x' \circ i$. Then $\xi = (U, U', a, i, x', \alpha)$
is the desired object over $U$.
\end{proof}

\begin{lemma}
\label{lemma-etale-local-lifts}
Let $\mathcal{X} \subset \mathcal{X}'$ be a thickening of algebraic stacks.
Let $W$ be an algebraic space and let $W \to \mathcal{X}$ be a smooth morphism.
There exists an \'etale covering $\{W_i \to W\}_{i \in I}$ and for each $i$
a cartesian diagram
$$
\xymatrix{
W_i \ar[r] \ar[d] & W_i' \ar[d] \\
\mathcal{X} \ar[r] & \mathcal{X}'
}
$$
with $W_i' \to \mathcal{X}'$ smooth.
\end{lemma}

\begin{proof}
Choose a scheme $U'$ and a surjective smooth morphism $U' \to \mathcal{X}'$.
As usual we set $U = \mathcal{X} \times_{\mathcal{X}'} U'$. Then
$U \to \mathcal{X}$ is a surjective smooth morphism. Therefore the base change
$$
V = W \times_{\mathcal{X}} U \longrightarrow W
$$
is a surjective smooth morphism of algebraic spaces.
By Topologies on Spaces, Lemma
\ref{spaces-topologies-lemma-etale-dominates-smooth}
we can find an \'etale covering $\{W_i \to W\}$ such
that $W_i \to W$ factors through $V \to W$.
After covering $W_i$ by affines (Properties of Spaces, Lemma
\ref{spaces-properties-lemma-cover-by-union-affines})
we may assume each $W_i$ is affine. We may and do replace $W$ by $W_i$
which reduces us to the situation discussed in the next paragraph.

\medskip\noindent
Assume $W$ is affine and the given morphism $W \to \mathcal{X}$ factors
through $U$. Picture
$$
W \xrightarrow{i} U \to \mathcal{X}
$$
Since $W$ and $U$ are smooth over $\mathcal{X}$ we see that
$i$ is locally of finite type (Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-finite-type-permanence}).
After replacing $U$ by $\mathbf{A}^n_U$ we may assume
that $i$ is an immersion, see
Morphisms, Lemma \ref{morphisms-lemma-quasi-affine-finite-type-over-S}.
By Morphisms of Stacks,
Lemma \ref{stacks-morphisms-lemma-lci-permanence}
the morphism $i$ is a local complete intersection.
Hence $i$ is a Koszul-regular immersion (as defined in
Divisors, Definition \ref{divisors-definition-regular-immersion})
by More on Morphisms, Lemma \ref{more-morphisms-lemma-lci}.

\medskip\noindent
We may still replace $W$ by an affine open covering.
For every point $w \in W$ we can choose an affine open
$U'_w \subset U'$ such that if $U_w \subset U$ is the
corresponding affine open, then $w \in i^{-1}(U_w)$ and
$i^{-1}(U_w) \to U_w$ is a closed immersion cut out
by a Koszul-regular sequence
$f_1, \ldots, f_r \in \Gamma(U_w, \mathcal{O}_{U_w})$.
This follows from the definition of Koszul-regular immersions
and Divisors, Lemma \ref{divisors-lemma-regular-ideal-sheaf-scheme}.
Set $W_w = i^{-1}(U_w)$; this is an affine open neighbourhood
of $w \in W$.
Choose lifts $f'_1, \ldots, f'_r \in \Gamma(U'_w, \mathcal{O}_{U'_w})$
of $f_1, \ldots, f_r$. This is possible as $U_w \to U'_w$
is a closed immersion of affine schemes.
Let $W'_w \subset U'_w$ be the closed subscheme cut out by
$f'_1, \ldots, f'_r$.
We claim that $W'_w \to \mathcal{X}'$ is smooth.
The claim finishes the proof as
$W_w = \mathcal{X} \times_{\mathcal{X}'} W'_w$
by construction.

\medskip\noindent
To check the claim it suffices to check that the base change
$W'_w \times_{\mathcal{X}'} X' \to X'$ is smooth for every
affine scheme $X'$ smooth over $\mathcal{X}'$. Choose an
\'etale morphism
$$
Y' \to U'_w \times_{\mathcal{X}'} X'
$$
with $Y'$ affine. Because $U'_w \times_{\mathcal{X}'} X'$ is covered
by the images of such morphisms, it is enough to show that the closed
subscheme $Z'$ of $Y'$ cut out by $f'_1, \ldots, f'_r$ is smooth over $X'$.
Picture
$$
\xymatrix{
Z' \ar[r] \ar[d] & Y' \ar[d] \\
W'_w \times_{\mathcal{X}'} X' \ar[d] \ar[r] &
U'_w \times_{\mathcal{X}'} X' \ar[d] \ar[r] & X' \\
W'_w = V(f'_1, \ldots, f'_r) \ar[r] & U'_w
}
$$
Set $X = \mathcal{X} \times_{\mathcal{X}'} X'$,
$Y = X \times_{X'} Y' = \mathcal{X} \times_{\mathcal{X}'} Y'$, and
$Z = Y \times_{Y'} Z' = X \times_{X'} Z' =
\mathcal{X} \times_{\mathcal{X}'} Z'$.
Then $(Z \subset Z') \to (Y \subset Y') \subset (X \subset X')$
are (cartesian) morphisms of thickenings of affine schemes and
we are given that $Z \to X$ and $Y' \to X'$ are smooth.
Finally, the sequence of functions $f'_1, \ldots, f'_r$
map to a Koszul-regular sequence in $\Gamma(Y', \mathcal{O}_{Y'})$ by
More on Algebra, Lemma \ref{more-algebra-lemma-koszul-regular-flat-base-change}
because $Y' \to U'_w$ is smooth and hence flat.
By More on Algebra, Lemma \ref{more-algebra-lemma-cut-by-koszul}
(and the fact that Koszul-regular sequences are quasi-regular sequences
by More on Algebra, Lemmas \ref{more-algebra-lemma-regular-koszul-regular},
\ref{more-algebra-lemma-koszul-regular-H1-regular}, and
\ref{more-algebra-lemma-H1-regular-quasi-regular})
we conclude that $Z' \to X'$ is smooth as desired.
\end{proof}

\begin{lemma}
\label{lemma-etale-local-lifts-isomorphic}
Let $\mathcal{X} \subset \mathcal{X}'$ be a thickening of algebraic stacks.
Consider a commutative diagram
$$
\xymatrix{
W'' \ar[d]_{x''} & W \ar[l] \ar[r] \ar[d]_x & W' \ar[d]^{x'} \\
\mathcal{X}' & \mathcal{X} \ar[l] \ar[r] & \mathcal{X}'
}
$$
with cartesian squares where $W', W, W''$ are algebraic spaces and
the vertical arrows are smooth. Then there exist
\begin{enumerate}
\item an \'etale covering $\{f'_k : W'_k \to W'\}_{k \in K}$,
\item \'etale morphisms $f''_k : W'_k \to W''$, and
\item $2$-morphisms $\gamma_k : x'' \circ f''_k \to x' \circ f'_k$
\end{enumerate}
such that (a) $(f'_k)^{-1}(W) = (f''_k)^{-1}(W)$, (b)
$f'_k|_{(f'_k)^{-1}(W)} = f''_k|_{(f''_k)^{-1}(W)}$, and
(c) pulling back $\gamma_k$ to the closed subscheme of (a)
agrees with the $2$-morphism given by the commutativity of
the initial diagram over $W$.
\end{lemma}

\begin{proof}
Denote $i : W \to W'$ and $i'' : W \to W''$ the given thickenings.
The commutativity of the diagram in the statement of the lemma
means there is a $2$-morphism $\delta : x' \circ i' \to x'' \circ i''$
This is the $2$-morphism referred to in part (c) of the statement.
Consider the algebraic space
$$
I' = W' \times_{x', \mathcal{X}', x''} W''
$$
with projections $p' : I' \to W'$ and $q' : I' \to W''$.
Observe that there is a ``universal'' $2$-morphism
$\gamma : x' \circ p' \to x'' \circ q'$ (we will use this later).
The choice of $\delta$ defines a morphism
$$
\xymatrix{
W \ar[rr]_\delta & & I' \ar[ld]^{p'} \ar[rd]_{q'} \\
& W' & & W''
}
$$
such that the compositions $W \to I' \to W'$ and $W \to I' \to W''$
are $i : W \to W'$ and $i' : W \to W''$.
Since $x''$ is smooth, the morphism $p' : I' \to W'$ is smooth
as a base change of $x''$.

\medskip\noindent
Suppose we can find an \'etale covering $\{f'_k : W'_k \to W'\}$
and morphisms $\delta_k : W'_k \to I'$ such that the restriction
of $\delta_k$ to $W_k = (f'_k)^{-1}$ is equal to $\delta \circ f_k$
where $f_k = f'_k|_{W_k}$. Picture
$$
\xymatrix{
W_k \ar[r]^{f_k} \ar[d] & W \ar[r]^\delta & I' \ar[d]^{p'} \\
W'_k \ar[rr]^{f'_k} \ar[rru]^{\delta_k} & & W'
}
$$
In other words, we want to be able to extend the given section
$\delta : W \to I'$ of $p'$ to a section over $W'$ after possibly
replacing $W'$ by an \'etale covering.

\medskip\noindent
If this is true, then we can set $f''_k = q' \circ \delta_k$
and $\gamma_k = \gamma \star \text{id}_{\delta_k}$ (more succinctly
$\gamma_k = \delta_k^*\gamma$). Namely, the only thing left to show
at this is that the morphism $f''_k$ is \'etale.
By construction the morphism $x' \circ p'$ is $2$-isomorphic
to $x'' \circ q'$. Hence $x'' \circ f''_k$ is $2$-isomorphic
to $x' \circ f'_k$. We conclude that the composition
$$
W'_k \xrightarrow{f''_k} W'' \xrightarrow{x''} \mathcal{X}'
$$
is smooth because $x' \circ f'_k$ is so.
As $f_k$ is \'etale we conclude $f''_k$ is \'etale
by Lemma \ref{lemma-deform-property-fp-over-ft}.

\medskip\noindent
If the thickening is a first order thickening, then we can
choose any \'etale covering $\{W'_k \to W'\}$ with $W_k'$ affine.
Namely, since $p'$ is smooth we see that $p'$ is formally smooth by the
infinitesimal lifting criterion (More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-smooth-formally-smooth}).
As $W_k$ is affine and as $W_k \to W'_k$ is a first order thickening
(as a base change of $\mathcal{X} \to \mathcal{X}'$, see
Lemma \ref{lemma-base-change-thickening}) we get $\delta_k$ as
desired.

\medskip\noindent
In the general case the existence of the covering and the morphisms
$\delta_k$ follows from More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-smooth-strong-lift}.
\end{proof}

\begin{lemma}
\label{lemma-gerbe-of-lifts}
The category $p : \mathcal{C} \to W_{spaces, \etale}$ constructed
in Remark \ref{remark-gerbe-of-lifts} is a gerbe.
\end{lemma}

\begin{proof}
In Lemma \ref{lemma-gerbe-of-lifts-stack}
we have seen that it is a stack in groupoids.
Thus it remains to check conditions (2) and (3) of
Stacks, Definition \ref{stacks-definition-gerbe}.
Condition (2) follows from
Lemma \ref{lemma-etale-local-lifts}.
Condition (3) follows from
Lemma \ref{lemma-etale-local-lifts-isomorphic}.
\end{proof}

\begin{lemma}
\label{lemma-gerbe-of-lifts-first-order}
In Remark \ref{remark-gerbe-of-lifts} assume $\mathcal{X} \subset \mathcal{X}'$
is a first order thickening. Then
\begin{enumerate}
\item the automorphism sheaves of objects of the gerbe
$p : \mathcal{C} \to W_{spaces, \etale}$ constructed
in Remark \ref{remark-gerbe-of-lifts} are abelian, and
\item the sheaf of groups $\mathcal{G}$ constructed in
Stacks, Lemma \ref{stacks-lemma-gerbe-abelian-auts}
is a quasi-coherent $\mathcal{O}_W$-module.
\end{enumerate}
\end{lemma}

\begin{proof}
We will prove both statements at the same time. Namely, given
an object $\xi = (U, U', a, i, x', \alpha)$ we will endow
$\mathit{Aut}(\xi)$ with the structure of a
quasi-coherent $\mathcal{O}_U$-module on $U_{spaces, \etale}$ and
we will show that this structure is compatible with pullbacks.
This will be sufficient by glueing of sheaves
(Sites, Section \ref{sites-section-glueing-sheaves})
and the construction of $\mathcal{G}$ in the proof of
Stacks, Lemma \ref{stacks-lemma-gerbe-abelian-auts}
as the glueing of the automorphism sheaves $\mathit{Aut}(\xi)$
and the fact that it suffices to check a module is
quasi-coherent after going to an \'etale covering
(Properties of Spaces, Lemma
\ref{spaces-properties-lemma-characterize-quasi-coherent}).

\medskip\noindent
We will describe the sheaf $\mathit{Aut}(\xi)$ using the
same method as used in the proof of
Lemma \ref{lemma-etale-local-lifts-isomorphic}.
Consider the algebraic space
$$
I' = U' \times_{x', \mathcal{X}', x'} U'
$$
with projections $p' : I' \to U'$ and $q' : I' \to U'$.
Over $I'$ there is a universal $2$-morphism
$\gamma : x' \circ p' \to x' \circ q'$.
The identity $x' \to x'$ defines a diagonal morphism
$$
\xymatrix{
U' \ar[rr]_{\Delta'} & & I' \ar[ld]^{p'} \ar[rd]_{q'} \\
& U' & & U'
}
$$
such that the compositions $U' \to I' \to U'$ and $U' \to I' \to U'$
are the identity morphisms. We will denote the base change of
$U', I', p', q', \Delta'$ to $\mathcal{X}$ by $U, I, p, q, \Delta$.
Since $W' \to \mathcal{X}'$ is smooth, we see that $p' : I' \to U'$
is smooth as a base change.

\medskip\noindent
A section of $\mathit{Aut}(\xi)$ over $U$ is a morphism $\delta' : U' \to I'$
such that $\delta'|_U = \Delta$ and such that
$p' \circ \delta' = \text{id}_{U'}$. To be explicit,
$(\text{id}_U, q' \circ \delta', (\delta')^*\gamma) : \xi \to \xi$
is a formula for the corresponding automorphism.
More generally, if
$f : V \to U$ is an \'etale morphism, then there is a thickening
$j : V \to V'$ and an \'etale morphism
$f' : V' \to U'$ whose restriction to $V$ is $f$ and $f^*\xi$
corresponds to $(V, V', a \circ f, j, x' \circ f', f^*\alpha)$, see proof of
Lemma \ref{lemma-gerbe-of-lifts-fibred}.
 a section of $\mathit{Aut}(\xi)$ over $V$ is a morphism
$\delta' : V' \to I'$
such that $\delta'|_V = \Delta \circ f$
and $p' \circ \delta' = f'$\footnote{A formula for the corresponding
automorphism is $(\text{id}_V, h', (\delta')^*\gamma)$.
Here $h' : V' \to V'$ is the unique (iso)morphism such that
$h'|_V = \text{id}_V$ and such that
$$
\xymatrix{
V' \ar[r]_{h'} \ar[rd]_{q' \circ \delta'} & V' \ar[d]^{f'} \\
& U'
}
$$
commutes. Uniqueness and existence of $h'$ by topological invariance of
the \'etale site, see More on Morphisms of Spaces,
Theorem \ref{spaces-more-morphisms-theorem-topological-invariance}.
The reader may feel we should instead look at morphisms
$\delta'' : V' \to V' \times_{\mathcal{X}'} V'$ with
$\delta'' \circ j = \Delta_{V'/\mathcal{X}'}$ and
$\text{pr}_1 \circ \delta'' = \text{id}_{V'}$.
This would be fine too: as $V' \times_{\mathcal{X}'} V' \to I'$ is \'etale,
the same topological invariance tells us that sending
$\delta''$ to $\delta' = (V' \times_{\mathcal{X}'} V' \to I') \circ \delta''$
is a bijection between the two
sets of morphisms.}.

\medskip\noindent
We conclude that $\mathit{Aut}(\xi)$ as a sheaf of sets agrees with
the sheaf defined in
More on Morphisms of Spaces, Remark
\ref{spaces-more-morphisms-remark-another-special-case}
for the thickenings $(U \subset U')$ and $(I \subset I')$ over
$(U \subset U')$ via $\text{id}_{U'}$ and $p'$.
The diagonal $\Delta'$ is a section of this sheaf and by
acting on this section using More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-action-sheaf}
we get an isomorphism
\begin{equation}
\label{equation-isomorphism}
\SheafHom_{\mathcal{O}_U}(\Delta^*\Omega_{I/U}, \mathcal{C}_{U/U'})
\longrightarrow
\mathit{Aut}(\xi)
\end{equation}
on $U_{spaces, \etale}$. There three things left to check
\begin{enumerate}
\item the construction of (\ref{equation-isomorphism})
commutes with \'etale localization,
\item $\SheafHom_{\mathcal{O}_U}(\Delta^*\Omega_{I/U}, \mathcal{C}_{U/U'})$
is a quasi-coherent module on $U$,
\item the composition in $\mathit{Aut}(\xi)$ corresponds
to addition of sections in this quasi-coherent module.
\end{enumerate}
We will check these in order.

\medskip\noindent
To see (1) we have to show that if $f : V \to U$ is \'etale,
then (\ref{equation-isomorphism}) constructed using $\xi$ over $U$,
restricts to the map (\ref{equation-isomorphism})
$$
\SheafHom_{\mathcal{O}_V}(
\Delta_V^*\Omega_{V \times_\mathcal{X} V/V}, \mathcal{C}_{V/V'}) \to
\mathit{Aut}(\xi|_V)
$$
constructed using $\xi|_V$ over $V$ on $V_{spaces, \etale}$.
This follows from the discussion in the footnote above
and More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-action-by-derivations-etale-localization}.

\medskip\noindent
Proof of (2). Since $p'$ is smooth, the morphism $I \to U$ is smooth,
and hence the relative module of differentials $\Omega_{I/U}$
is finite locally free (More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-smooth-omega-finite-locally-free}).
On the other hand, $\mathcal{C}_{U/U'}$ is quasi-coherent
(More on Morphisms of Spaces, Definition
\ref{spaces-more-morphisms-definition-conormal-sheaf}).
By Properties of Spaces, Lemma
\ref{spaces-properties-lemma-properties-quasi-coherent}
we conclude.

\medskip\noindent
Proof of (3). There exists a morphism $c' : I' \times_{p', U', q'} I' \to I'$
such that $(U', I', p', q', c')$ is a groupoid in algebraic spaces
with identity $\Delta'$. See
Algebraic Stacks, Lemma \ref{algebraic-lemma-map-space-into-stack} for example.
Composition in $\mathit{Aut}(\xi)$ is induced by the morphism
$c'$ as follows. Suppose we have two morphisms
$$
\delta'_1, \delta'_2 : U' \longrightarrow I'
$$
corresponding to sections of $\mathit{Aut}(\xi)$ over $U$ as above,
in other words, we have $\delta'_i|U = \Delta_U$ and
$p' \circ \delta'_i = \text{id}_{U'}$. Then the composition
in $\mathit{Aut}(\xi)$ is
$$
\delta'_1 \circ \delta'_2 = c'(\delta'_1 \circ q' \circ \delta'_2, \delta'_2)
$$
We omit the detailed verification\footnote{The reader can see immediately
that it is necessary to precompose
$\delta'_1$ by $q' \circ \delta'_2$ to get a well defined $U'$-valued
point of the fibre product $I' \times_{p', U', q'} I'$.}.
Thus we are in the situation described in
More on Groupoids in Spaces, Section
\ref{spaces-more-groupoids-section-groupoid-sections}
and the desired result follows from
More on Groupoids in Spaces, Lemma
\ref{spaces-more-groupoids-lemma-composition-is-addition}.
\end{proof}

\begin{proposition}[Emerton]
\label{proposition-affine-smooth-lift-to-first-order}
\begin{reference}
Email of Matthew Emerton dated April 27, 2016.
\end{reference}
Let $\mathcal{X} \subset \mathcal{X}'$ be a first order thickening
of algebraic stacks. Let $W$ be an affine scheme and let
$W \to \mathcal{X}$ be a smooth morphism. Then there exists
a cartesian diagram
$$
\xymatrix{
W \ar[d] \ar[r] & W' \ar[d] \\
\mathcal{X} \ar[r] & \mathcal{X}'
}
$$
with $W' \to \mathcal{X}'$ smooth and $W'$ affine.
\end{proposition}

\begin{proof}
Consider the category $p : \mathcal{C} \to W_{spaces, \etale}$
introduced in Remark \ref{remark-gerbe-of-lifts}.
The proposition states that there exists an object of $\mathcal{C}$
lying over $W$. Namely, if we have such an object
$(W, W', a, i, y', \alpha)$ then $W = \mathcal{X} \times_{\mathcal{X}'} W'$.
Hence $W \to W'$ is a thickening of algebraic spaces so
$W'$ is affine by
More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-thickening-scheme}
and More on Morphisms, Lemma
\ref{more-morphisms-lemma-thickening-affine-scheme}.

\medskip\noindent
Lemma \ref{lemma-gerbe-of-lifts} tells us $\mathcal{C}$ is a gerbe over
$W_{spaces, \etale}$. This means we can \'etale locally find a solution and
these local solutions are \'etale locally isomorphic;
this part does not require the assumption that the thickening is first order.
By Lemma \ref{lemma-gerbe-of-lifts-first-order}
the automorphism sheaves of objects of our gerbe are abelian and
fit together to form a quasi-coherent module $\mathcal{G}$
on $W_{spaces, \etale}$. We will verify conditions (1) and (2)
of Cohomology on Sites, Lemma \ref{sites-cohomology-lemma-existence}
to conclude the existence of an object of $\mathcal{C}$ lying over $W$.
Condition (1) is true: the \'etale coverings $\{W_i \to W\}$
with each $W_i$ affine are cofinal in the collection of all coverings.
For such a covering $W_i$ and $W_i \times_W W_j$ are affine
and $H^1(W_i, \mathcal{G})$ and $H^1(W_i \times_W W_j, \mathcal{G})$
are zero: the cohomology of a quasi-coherent module over an affine
algebraic space is zero for example by Cohomology of Spaces, Proposition
\ref{spaces-cohomology-proposition-vanishing}.
Finally, condition (2) is that $H^2(W, \mathcal{G}) = 0$
for our quasi-coherent sheaf $\mathcal{G}$ which again follows
from Cohomology of Spaces, Proposition
\ref{spaces-cohomology-proposition-vanishing}.
This finishes the proof.
\end{proof}






\section{Infinitesimal deformations}
\label{section-inf}

\noindent
We continue the discussion from
Artin's Axioms, Section \ref{artin-section-inf}.

\begin{lemma}
\label{lemma-inf-quasi-coherent}
Let $\mathcal{X}$ be an algebraic stack over a scheme $S$.
Assume $\mathcal{I}_\mathcal{X} \to \mathcal{X}$ is locally
of finite presentation. Let $A \to B$ be a flat $S$-algebra homomorphism.
Let $x$ be an object of $\mathcal{X}$ over $A$ and set $y = x|_B$.
Then $\text{Inf}_x(M) \otimes_A B = \text{Inf}_y(M \otimes_A B)$.
\end{lemma}

\begin{proof}
Recall that $\text{Inf}_x(M)$ is the set of automorphisms of the
trivial deformation of $x$ to $A[M]$ which induce the identity
automorphism of $x$ over $A$. The trivial deformation is
the pullback of $x$ to $\Spec(A[M])$ via $\Spec(A[M]) \to \Spec(A)$.
Let $G \to \Spec(A)$ be the automorphism group algebraic space of $x$
(this exists because $\mathcal{X}$ is an algebraic space).
Let $e : \Spec(A) \to G$ be the neutral element.
The discussion in More on Morphisms of Spaces, Section
\ref{spaces-more-morphisms-section-action-by-derivations}
gives
$$
\text{Inf}_x(M) = \Hom_A(e^*\Omega_{G/A}, M)
$$
By the same token
$$
\text{Inf}_y(M \otimes_A B) = \Hom_B(e_B^*\Omega_{G_B/B}, M \otimes_A B)
$$
Since $G \to \Spec(A)$ is locally of finite presentation by
assumption, we see that $\Omega_{G/A}$ is locally of finite
presentation, see
More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-finite-presentation-differentials}.
Hence $e^*\Omega_{G/A}$ is a finitely presented $A$-module.
Moreover, $\Omega_{G_B/B}$ is the pullback of $\Omega_{G/A}$ by
More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-base-change-differentials}.
Therefore $e_B^*\Omega_{G_B/B} = e^*\Omega_{G/A} \otimes_A B$.
we conclude by More on Algebra, Lemma
\ref{more-algebra-lemma-pseudo-coherence-and-base-change-ext}.
\end{proof}

\begin{lemma}
\label{lemma-sheaf-of-infinitesimal-lifts}
Let $\mathcal{X}$ be an algebraic stack over a base scheme $S$.
Assume $\mathcal{I}_\mathcal{X} \to \mathcal{X}$ is locally
of finite presentation. Let $(A' \to A, x)$ be a deformation situation.
Then the functor
$$
F : B' \longmapsto
\{\text{lifts of }x|_{B' \otimes_{A'} A}\text{ to } B'\}/\text{isomorphisms}
$$
is a sheaf on the site $(\textit{Aff}/\Spec(A'))_{fppf}$ of
Topologies, Definition \ref{topologies-definition-big-small-fppf}.
\end{lemma}

\begin{proof}
Let $\{T'_i \to T'\}_{i = 1, \ldots n}$ be a standard fppf covering
of affine schemes over $A'$. Write $T' = \Spec(B')$. As usual denote
$$
T'_{i_0 \ldots i_p} =
T'_{i_0} \times_{T'} \ldots \times_{T'} T'_{i_p} = \Spec(B'_{i_0 \ldots i_p})
$$
where the ring is a suitable tensor product.
Set $B = B' \otimes_{A'} A$ and
$B_{i_0 \ldots i_p} = B'_{i_0 \ldots i_p} \otimes_{A'} A$.
Denote $y = x|_B$ and $y_{i_0 \ldots i_p} = x|_{B_{i_0 \ldots i_p}}$.
Let $\gamma_i \in F(B'_i)$ such that $\gamma_{i_0}$ and $\gamma_{i_1}$
map to the same element of $F(B'_{i_0i_1})$.
We have to find a unique $\gamma \in F(B')$ mapping to
$\gamma_i$ in $F(B'_i)$.

\medskip\noindent
Choose an actual object $y'_i$ of $\textit{Lift}(y_i, B'_i)$
in the isomorphism class $\gamma_i$.
Choose isomorphisms
$\varphi_{i_0i_1} : y'_{i_0}|_{B'_{i_0i_1}} \to y'_{i_1}|_{B'_{i_0i_1}}$
in the category $\textit{Lift}(y_{i_0i_1}, B'_{i_0i_1})$.
If the maps $\varphi_{i_0i_1}$ satisfy the cocycle condition,
then we obtain our object $\gamma$ because $\mathcal{X}$ is
a stack in the fppf topology. The cocycle condition is that the
composition
$$
y'_{i_0}|_{B'_{i_0i_1i_2}}
\xrightarrow{\varphi_{i_0i_1}|_{B'_{i_0i_1i_2}}}
y'_{i_1}|_{B'_{i_0i_1i_2}}
\xrightarrow{\varphi_{i_1i_2}|_{B'_{i_0i_1i_2}}}
y'_{i_2}|_{B'_{i_0i_1i_2}}
\xrightarrow{\varphi_{i_2i_0}|_{B'_{i_0i_1i_2}}}
y'_{i_0}|_{B'_{i_0i_1i_2}}
$$
is the identity. If not, then these maps give elements
$$
\delta_{i_0i_1i_2} \in
\text{Inf}_{y_{i_0i_1i_2}}(J_{i_0i_1i_2}) =
\text{Inf}_y(J) \otimes_B B_{i_0i_1i_2}
$$
Here $J = \Ker(B' \to B)$ and
$J_{i_0 \ldots i_p} = \Ker(B'_{i_0 \ldots i_p} \to B_{i_0 \ldots i_p})$.
The equality in the displayed equation holds by
Lemma \ref{lemma-inf-quasi-coherent} applied to
$B' \to B'_{i_0 \ldots i_p}$ and $y$ and $y_{i_0 \ldots i_p}$,
the flatness of the maps $B' \to B'_{i_0 \ldots i_p}$
which also guarantees that
$J_{i_0 \ldots i_p} = J \otimes_{B'} B'_{i_0 \ldots i_p}$.
A computation (omitted) shows that $\delta_{i_0i_1i_2}$ gives
a $2$-cocycle in the {\v C}ech complex
$$
\prod \text{Inf}_y(J) \otimes_B B_{i_0} \to
\prod \text{Inf}_y(J) \otimes_B B_{i_0i_1} \to
\prod \text{Inf}_y(J) \otimes_B B_{i_0i_1i_2} \to \ldots
$$
By Descent, Lemma \ref{descent-lemma-standard-covering-Cech-quasi-coherent}
this complex is acyclic in positive degrees and has $H^0 = \text{Inf}_y(J)$.
Since $\text{Inf}_{y_{i_0i_1}}(J_{i_0i_1})$ acts on
morphisms (Artin's Axioms, Remark \ref{artin-remark-automorphisms})
this means we can modify our choice of $\varphi_{i_0i_1}$
to get to the case where $\delta_{i_0i_1i_2} = 0$.

\medskip\noindent
Uniqueness. We still have to show there is at most one $\gamma$ restricting
to $\gamma_i$ for all $i$. Suppose we have objects $y', z'$ of
$\textit{Lift}(y, B')$ and isomorphisms $\psi_i : y'|_{B'_i} \to z'|_{B'_i}$
in $\textit{Lift}(y_i, B'_i)$. Then we can consider
$$
\psi_{i_1}^{-1} \circ \psi_{i_0} \in
\text{Inf}_{y_{i_0i_1}}(J_{i_0i_1}) =
\text{Inf}_y(J) \otimes_B B_{i_0i_1}
$$
Arguing as before, the obstruction to finding an isomorphism between
$y'$ and $z'$ over $B'$ is an element in the $H^1$ of the
{\v C}ech complex displayed above which is zero.
\end{proof}

\begin{lemma}
\label{lemma-T-quasi-coherent}
Let $\mathcal{X}$ be an algebraic stack over a scheme $S$ whose
structure morphism $\mathcal{X} \to S$ is locally of finite presentation.
Let $A \to B$ be a flat $S$-algebra homomorphism.
Let $x$ be an object of $\mathcal{X}$ over $A$.
Then $T_x(M) \otimes_A B = T_y(M \otimes_A B)$.
\end{lemma}

\begin{proof}
Choose a scheme $U$ and a surjective smooth morphism $U \to \mathcal{X}$.
We first reduce the lemma to the case where $x$ lifts to $U$.
Recall that $T_x(M)$ is the set of isomorphism classes of lifts of $x$
to $A[M]$. Therefore
Lemma \ref{lemma-sheaf-of-infinitesimal-lifts}\footnote{This lemma applies:
$\Delta : \mathcal{X} \to \mathcal{X} \times_S \mathcal{X}$
is locally of finite presentation by
Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-finite-presentation-permanence}
and the assumption that $\mathcal{X} \to S$ is locally of finite presentation.
Therefore $\mathcal{I}_\mathcal{X} \to \mathcal{X}$ is locally
of finite presentation as a base change of $\Delta$.}
says that the rule
$$
A_1 \mapsto T_{x|_{A_1}}(M \otimes_A A_1)
$$
is a sheaf on the small \'etale site of $\Spec(A)$; the tensor product
is needed to make $A[M] \to A_1[M \otimes_A A_1]$ a flat ring map.
We may choose a faithfully flat \'etale ring map $A \to A_1$
such that $x|_{A_1}$ lifts to a morphism $u_1 : \Spec(A_1) \to U$, see
for example Sheaves on Stacks, Lemma
\ref{stacks-sheaves-lemma-surjective-flat-locally-finite-presentation}.
Write $A_2 = A_1 \otimes_A A_1$ and set $B_1 = B \otimes_A A_1$
and $B_2 = B \otimes_A A_2$. Consider the diagram
$$
\xymatrix{
0 \ar[r] &
T_y(M \otimes_A B) \ar[r] &
T_{y|_{B_1}}(M \otimes_A B_1) \ar[r] &
T_{y|_{B_2}}(M \otimes_A B_2) \\
0 \ar[r] &
T_x(M) \ar[r] \ar[u] &
T_{x|_{A_1}}(M \otimes_A A_1) \ar[r] \ar[u] &
T_{x|_{A_2}}(M \otimes_A A_2) \ar[u]
}
$$
The rows are exact by the sheaf condition. We have
$M \otimes_A B_i = (M \otimes_A A_i) \otimes_{A_i} B_i$.
Thus if we prove the result for the middle and right vertical arrow, then
the result follows. This reduces us to the case discussed in
the next paragraph.

\medskip\noindent
Assume that $x$ is the image of a morphism $u : \Spec(A) \to U$.
Observe that $T_u(M) \to T_x(M)$ is surjective since
$U \to \mathcal{X}$ is smooth and representable by
algebraic spaces, see Criteria for Representability, Lemma
\ref{criteria-lemma-representable-by-spaces-formally-smooth}
(see discussion preceding it for explanation) and
More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-smooth-formally-smooth}.
Set $R = U \times_\mathcal{X} U$. Recall that we obtain
a groupoid $(U, R, s, t, c, e, i)$ in algebraic spaces with
$\mathcal{X} = [U/R]$. By
Artin's Axioms, Lemma \ref{artin-lemma-ses-inf-and-T}
we have an exact sequence
$$
T_{e \circ u}(M) \to T_u(M) \oplus T_u(M) \to T_x(M) \to 0
$$
where the zero on the right was shown above. A similar sequence
holds for the base change to $B$. Thus the result we want follows if
we can prove the result of the lemma for
$T_u(M)$ and $T_{e \circ u}(M)$. This reduces us to the case discussed
in the next paragraph.

\medskip\noindent
Assume that $\mathcal{X} = X$ is an algebraic space locally of finite
presentation over $S$. Then we have
$$
T_x(M) = \Hom_A(x^*\Omega_{X/S}, M)
$$
by the discussion in More on Morphisms of Spaces, Section
\ref{spaces-more-morphisms-section-action-by-derivations}.
By the same token
$$
T_y(M \otimes_A B) = \Hom_B(y^*\Omega_{X/S}, M \otimes_A B)
$$
Since $X \to S$ is locally of finite presentation, we see that
$\Omega_{X/S}$ is locally of finite presentation, see
More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-finite-presentation-differentials}.
Hence $x^*\Omega_{X/S}$ is a finitely presented $A$-module.
Clearly, we have $y^*\Omega_{X/S} = x^*\Omega_{X/S} \otimes_A B$.
we conclude by More on Algebra, Lemma
\ref{more-algebra-lemma-pseudo-coherence-and-base-change-ext}.
\end{proof}

\begin{lemma}
\label{lemma-local-lift-enough}
Let $\mathcal{X}$ be an algebraic stack over a scheme $S$ whose
structure morphism $\mathcal{X} \to S$ is locally of finite presentation.
Let $(A' \to A, x)$ be a deformation situation. If there exists a
faithfully flat finitely presented $A'$-algebra $B'$ and an
object $y'$ of $\mathcal{X}$ over $B'$ lifting $x|_{B' \otimes_{A'} A}$,
then there exists an object $x'$ over $A'$ lifting $x$.
\end{lemma}

\begin{proof}
Let $I = \Ker(A' \to A)$. Set $B'_1 = B' \otimes_{A'} B'$ and
$B'_2 = B' \otimes_{A'} B' \otimes_{A'} B'$. Let
$J = IB'$, $J_1 = IB'_1$, $J_2 = IB'_2$ and
$B = B'/J$, $B_1 = B'_1/J_1$, $B_2 = B'_2/J_2$.
Set $y = x|_B$, $y_1 = x|_{B_1}$, $y_2 = x|_{B_2}$.
Let $F$ be the fppf sheaf of
Lemma \ref{lemma-sheaf-of-infinitesimal-lifts}
(which applies, see footnote in the proof of
Lemma \ref{lemma-T-quasi-coherent}).
Thus we have an equalizer diagram
$$
\xymatrix{
F(A') \ar[r] &
F(B') \ar@<1ex>[r] \ar@<-1ex>[r] &
F(B'_1)
}
$$
On the other hand, we have $F(B') = \text{Lift}(y, B')$,
$F(B'_1) = \text{Lift}(y_1, B'_1)$, and $F(B'_2) = \text{Lift}(y_2, B'_2)$
in the terminology from Artin's Axioms, Section \ref{artin-section-inf}.
These sets are nonempty and are (canonically) principal homogeneous spaces for
$T_y(J)$, $T_{y_1}(J_1)$, $T_{y_2}(J_2)$, see
Artin's Axioms, Lemma \ref{artin-lemma-properties-lift-RS-star}.
Thus the difference of the two images of $y'$ in
$F(B'_1)$ is an element
$$
\delta_1 \in T_{y_1}(J_1) = T_x(I) \otimes_A B_1
$$
The equality in the displayed equation holds by
Lemma \ref{lemma-T-quasi-coherent} applied to
$A' \to B'_1$ and $x$ and $y_1$, the flatness of $A' \to B'_1$
which also guarantees that $J_1 = I \otimes_{A'} B'_1$. We have
similar equalities for $B'$ and $B'_2$.
A computation (omitted) shows that $\delta_1$ gives
a $1$-cocycle in the {\v C}ech complex
$$
T_x(I) \otimes_A B \to
T_x(I) \otimes_A B_1 \to
T_x(I) \otimes_A B_2 \to \ldots
$$
By Descent, Lemma \ref{descent-lemma-standard-covering-Cech-quasi-coherent}
this complex is acyclic in positive degrees and has $H^0 = T_x(I)$.
Thus we may choose an element in $T_x(I) \otimes_A B = T_y(J)$
whose boundary is $\delta_1$. Replacing $y'$ by the result
of this element acting on it, we find a new choice $y'$ with $\delta_1 = 0$.
Thus $y'$ maps to the same element under the two maps
$F(B') \to F(B'_1)$ and we obtain an element o $F(A')$ by
the sheaf condition.
\end{proof}












\section{Formally smooth morphisms}
\label{section-formally-smooth}

\noindent
In this section we introduce the notion of a formally smooth morphism
$\mathcal{X} \to \mathcal{Y}$ of algebraic stacks. Such a morphism is
characterized by the property that $T$-valued points of $\mathcal{X}$ lift
to infinitesimal thickenings of $T$ provided $T$ is affine.
The main result is that a morphism which is formally smooth and
locally of finite presentation is smooth, see
Lemma \ref{lemma-smooth-formally-smooth}.
It turns out that this criterion is often easier to use than the
Jacobian criterion.

\begin{definition}
\label{definition-formally-smooth}
A morphism $f : \mathcal{X} \to \mathcal{Y}$ of algebraic stacks is said to be
{\it formally smooth} if it is formally smooth on objects as a
$1$-morphism in categories fibred in groupoids as explained in
Criteria for Representability, Section \ref{criteria-section-formally-smooth}.
\end{definition}

\noindent
We translate the condition of the definition into the language we are currently
using (see
Properties of Stacks, Section \ref{stacks-properties-section-conventions}).
Let $f : \mathcal{X} \to \mathcal{Y}$ be a morphism of algebraic stacks.
Consider a $2$-commutative solid diagram
\begin{equation}
\label{equation-diagram}
\vcenter{
\xymatrix{
T \ar[r]_-x \ar[d]_i & \mathcal{X} \ar[d]^f \\
T' \ar[r]^-y \ar@{..>}[ru] & \mathcal{Y}
}
}
\end{equation}
where $i : T \to T'$ is a first order thickening of affine schemes.
Let
$$
\gamma : y \circ i \longrightarrow f \circ x
$$
be a $2$-morphism witnessing the $2$-commutativity of the diagram.
(Notation as in Categories, Sections \ref{categories-section-formal-cat-cat}
and \ref{categories-section-2-categories}.)
Given (\ref{equation-diagram}) and $\gamma$
a {\it dotted arrow} is a triple $(x', \alpha, \beta)$ consisting of a
morphism $x' : T' \to \mathcal{X}$ and $2$-arrows
$\alpha : x' \circ i \to x$, $\beta : y \to f \circ x'$
such that
$\gamma = (\text{id}_f \star \alpha) \circ (\beta \star \text{id}_i)$,
in other words such that
$$
\xymatrix{
& f \circ x' \circ i \ar[rd]^{\text{id}_f \star \alpha} \\
y \circ i \ar[ru]^{\beta \star \text{id}_i} \ar[rr]^\gamma & &
f \circ x
}
$$
is commutative. A {\it morphism of dotted arrows}
$(x'_1, \alpha_1, \beta_1) \to (x'_2, \alpha_2, \beta_2)$ is a
$2$-arrow $\theta : x'_1 \to x'_2$ such that
$\alpha_1 = \alpha_2 \circ (\theta \star \text{id}_i)$ and
$\beta_2 = (\text{id}_f \star \theta) \circ \beta_1$.

\medskip\noindent
The category of dotted arrows just described is a special case of 
Categories, Definition \ref{categories-definition-dotted-arrows}.

\begin{lemma}
\label{lemma-reformulate-formal-smoothness}
A morphism $f : \mathcal{X} \to \mathcal{Y}$ of algebraic stacks is
formally smooth (Definition \ref{definition-formally-smooth})
if and only if for every diagram (\ref{equation-diagram}) and $\gamma$
the category of dotted arrows is nonempty.
\end{lemma}

\begin{proof}
Translation between different languages omitted.
\end{proof}

\begin{lemma}
\label{lemma-base-change-formal-smoothness}
The base change of a formally smooth morphism of algebraic stacks
by any morphism of algebraic stacks is formally smooth.
\end{lemma}

\begin{proof}
Follows from
Categories, Lemma \ref{categories-lemma-cat-dotted-arrows-base-change}
and the definition.
\end{proof}

\begin{lemma}
\label{lemma-composition-formal-smoothness}
The composition of formally smooth morphisms of algebraic stacks
is formally smooth.
\end{lemma}

\begin{proof}
Follows from
Categories, Lemma \ref{categories-lemma-cat-dotted-arrows-composition}
and the definition.
\end{proof}

\begin{lemma}
\label{lemma-formal-smoothness-representable}
Let $f : \mathcal{X} \to \mathcal{Y}$ be a morphism of algebraic stacks
which is representable by algebraic spaces. Then the following are equivalent
\begin{enumerate}
\item $f$ is formally smooth,
\item for every scheme $T$ and morphism $T \to \mathcal{Y}$
the morphism $\mathcal{X} \times_\mathcal{Y} T \to T$
is formally smooth as a morphism of algebraic spaces.
\end{enumerate}
\end{lemma}

\begin{proof}
Follows from
Categories, Lemma \ref{categories-lemma-cat-dotted-arrows-base-change}
and the definition.
\end{proof}

\begin{lemma}
\label{lemma-lift-to-smooth}
Let $T \to T'$ be a first order thickening of affine schemes.
Let $\mathcal{X}'$ be an algebraic stack over $T'$
whose structure morphism $\mathcal{X}' \to T'$ is smooth.
Let $x : T \to \mathcal{X}'$ be a morphism
over $T'$. Then there exists a morphsm $x' : T' \to \mathcal{X}'$
over $T'$ with $x'|_T = x$.
\end{lemma}

\begin{proof}
We may apply the result of Lemma \ref{lemma-local-lift-enough}.
Thus it suffices to construct a smooth surjective morphism
$W' \to T'$ with $W'$ affine such that
$x|_{T \times_{W'} T'}$ lifts to $W'$.
(We urge the reader to find their own proof of this fact
using the analogous result for algebraic spaces already
established.) We choose a
scheme $U'$ and a surjective smooth morphism $U' \to \mathcal{X}'$.
Observe that $U' \to T'$ is smooth and that the projection
$T \times_{\mathcal{X}'} U' \to T$ is surjective smooth.
Choose an affine scheme $W$ and an \'etale morphism
$W \to T \times_{\mathcal{X}'} U'$ such that $W \to T$
is surjective. Then $W \to T$ is a smooth morphism of
affine schemes. After replacing $W$ by a disjoint union of
principal affine opens, we may assume there exists a
smooth morphism of affines $W' \to T'$ such that
$W = T \times_{T'} W'$, see Algebra, Lemma \ref{algebra-lemma-lift-smooth}.
By More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-smooth-formally-smooth}
we can find a morphism $W' \to U'$ over $T'$ lifting
the given morphism $W \to U'$. This finishes the proof.
\end{proof}

\noindent
The following lemma is the main result of this section.
It implies, combined with
Limits of Stacks, Proposition
\ref{stacks-limits-proposition-characterize-locally-finite-presentation},
that we can recognize whether a morphism of algebraic stacks
$f : \mathcal{X} \to \mathcal{Y}$ is smooth in terms of
``simple'' properties of the $1$-morphism of stacks in groupoids
$\mathcal{X} \to \mathcal{Y}$.

\begin{lemma}[Infinitesimal lifting criterion]
\label{lemma-smooth-formally-smooth}
Let $f : \mathcal{X} \to \mathcal{Y}$ be a morphism of algebraic stacks.
The following are equivalent:
\begin{enumerate}
\item The morphism $f$ is smooth.
\item The morphism $f$ is locally of finite presentation and
formally smooth.
\end{enumerate}
\end{lemma}

\begin{proof}
Assume $f$ is smooth. Then $f$ is locally of finite presentation by
Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-smooth-locally-finite-presentation}.
Hence it suffices given a diagram (\ref{equation-diagram})
and a $\gamma : y \circ i \to f \circ x$ to find a dotted
arrow (see Lemma \ref{lemma-reformulate-formal-smoothness}).
Forming fibre products we obtain
$$
\xymatrix{
T \ar[d] \ar[r] &
T' \times_\mathcal{Y} \mathcal{X} \ar[d] \ar[r] &
\mathcal{X} \ar[d] \\
T' \ar[r] & T' \ar[r] & \mathcal{Y}
}
$$
Thus we see it is sufficient to find a dotted arrow in the
left square. Since $T' \times_\mathcal{Y} \mathcal{X} \to T'$
is smooth
(Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-base-change-smooth})
existence of a dotted arrow in the left square is guaranteed by
Lemma \ref{lemma-lift-to-smooth}.

\medskip\noindent
Conversely, suppose that $f$ is locally of finite presentation and
formally smooth. Choose a scheme $U$ and a surjective smooth morphism
$U \to \mathcal{X}$. Then $a : U \to \mathcal{X}$ and $b : U \to \mathcal{Y}$
are representable by algebraic spaces and locally of finite presentation
(use Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-composition-finite-presentation}
and the fact seen above
that a smooth morphism is locally of finite presentation).
We will apply the general principle of
Algebraic Stacks, Lemma
\ref{algebraic-lemma-representable-transformations-property-implication}
with as input the equivalence of More on Morphisms of Spaces,
Lemma \ref{spaces-more-morphisms-lemma-smooth-formally-smooth}
and simultaneously use the translation of
Criteria for Representability, Lemma
\ref{criteria-lemma-representable-by-spaces-formally-smooth}.
We first apply this to $a$ to see that $a$ is
formally smooth on objects. Next, we use that $f$ is
formally smooth on objects by assumption
(see Lemma \ref{lemma-reformulate-formal-smoothness})
and Criteria for Representability, Lemma
\ref{criteria-lemma-composition-formally-smooth}
to see that $b = f \circ a$ is formally smooth on objects.
Then we apply the principle once more to conclude that $b$ is smooth.
This means that $f$ is smooth by the definition of smoothness
for morphisms of algebraic stacks and the proof is complete.
\end{proof}









\section{Blowing up and flatness}
\label{section-blowup-flat}

\noindent
This section quickly discusses what you can deduce from
More on Morphisms of Spaces, Sections
\ref{spaces-more-morphisms-section-blowup-flat} and
\ref{spaces-more-morphisms-section-applications-flattening-by-blowing-up}
for algebraic stacks over algebraic spaces.

\begin{lemma}
\label{lemma-flatten-stack}
Let $f : \mathcal{X} \to Y$ be a morphism from an algebraic stack
to an algebraic space. Let $V \subset Y$ be an open subspace. Assume
\begin{enumerate}
\item $Y$ is quasi-compact and quasi-separated,
\item $f$ is of finite type and quasi-separated,
\item $V$ is quasi-compact, and
\item $\mathcal{X}_V$ is flat and locally of finite presentation over $V$.
\end{enumerate}
Then there exists a $V$-admissible blowup $Y' \to Y$
and a closed substack $\mathcal{X}' \subset \mathcal{X}_{Y'}$
with $\mathcal{X}'_V = \mathcal{X}_V$ such that
$\mathcal{X}' \to Y'$ is flat and of finite presentation.
\end{lemma}

\begin{proof}
Observe that $\mathcal{X}$ is quasi-compact.
Choose an affine scheme $U$ and a surjective smooth
morphism $U \to \mathcal{X}$.
Let $R = U \times_\mathcal{X} U$ so that we obtain
a groupoid $(U, R, s, t, c)$ in algebraic spaces over $Y$ with
$\mathcal{X} = [U/R]$
(Algebraic Stacks, Lemma \ref{algebraic-lemma-stack-presentation}).
We may apply
More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-flat-after-blowing-up}
to $U \to Y$ and the open $V \subset Y$.
Thus we obtain a $V$-admissible blowup $Y' \to Y$
such that the strict transform $U' \subset U_{Y'}$
is flat and of finite presentation over $Y'$.
Let $R' \subset R_{Y'}$ be the strict transform of $R$.
Since $s$ and $t$ are smooth (and in particular flat)
it follows from
Divisors on Spaces, Lemma
\ref{spaces-divisors-lemma-strict-transform-flat}
that we have cartesian diagrams
$$
\vcenter{
\xymatrix{
R' \ar[r] \ar[d] & R_{Y'} \ar[d]^{s_{Y'}} \\
U' \ar[r] & U_{Y'}
}
}
\quad\text{and}\quad
\vcenter{
\xymatrix{
R' \ar[r] \ar[d] & R_{Y'} \ar[d]^{t_{Y'}} \\
U' \ar[r] & U_{Y'}
}
}
$$
In other words, $U'$ is an $R_{Y'}$-invariant closed subspace
of $U_{Y'}$. Thus $U'$ defines a closed substack
$\mathcal{X}' \subset \mathcal{X}_{Y'}$ by
Properties of Stacks, Lemma
\ref{stacks-properties-lemma-substacks-presentation}.
The morphism $\mathcal{X}' \to Y'$ is flat and
locally of finite presentation because this is
true for $U' \to Y'$. On the other hand,
we already know $\mathcal{X}' \to Y'$ is quasi-compact and quasi-separated
(by our assumptions on $f$ and because this is true for closed immersions).
This finishes the proof.
\end{proof}















\section{Chow's lemma for algebraic stacks}
\label{section-chow}

\noindent
In this section we discuss Chow's lemma for algebraic stacks.

\begin{lemma}
\label{lemma-finite-cover-factor}
Let $Y$ be a quasi-compact and quasi-separated algebraic space.
Let $V \subset Y$ be a quasi-compact open. Let $f : \mathcal{X} \to V$
be surjective, flat, and locally of finite presentation.
Then there exists a finite surjective morphism $g : Y' \to Y$ such that
$V' = g^{-1}(V) \to Y$ factors Zariski locally through $f$.
\end{lemma}

\begin{proof}
We first prove this when $Y$ is a scheme.
We may choose a scheme $U$ and a surjective smooth morphism
$U \to \mathcal{X}$. Then $\{U \to V\}$ is an fppf covering of schemes.
By More on Morphisms, Lemma \ref{more-morphisms-lemma-dominate-fppf-finite}
there exists a finite surjective morphism
$V' \to V$ such that $V' \to V$ factors Zariski locally
through $U$. By
More on Morphisms, Lemma
\ref{more-morphisms-lemma-extend-finite-surjective-morphisms}
we can find a finite surjective morphism $Y' \to Y$
whose restriction to $V$ is $V' \to V$ as desired.

\medskip\noindent
If $Y$ is an algebraic space, then we see the lemma is true by
first doing a finite base change by a finite surjective morphism
$Y' \to Y$ where $Y'$ is a scheme. See
Limits of Spaces, Proposition
\ref{spaces-limits-proposition-there-is-a-scheme-finite-over}.
\end{proof}

\begin{lemma}
\label{lemma-make-section}
Let $f : \mathcal{X} \to Y$ be a morphism from an algebraic stack
to an algebraic space. Let $V \subset Y$ be an open subspace.
Assume
\begin{enumerate}
\item $f$ is separated and of finite type,
\item $Y$ is quasi-compact and quasi-separated,
\item $V$ is quasi-compact, and
\item $\mathcal{X}_V$ is a gerbe over $V$.
\end{enumerate}
Then there exists a commutative diagram
$$
\xymatrix{
\overline{Z} \ar[rd]_{\overline{g}} &
Z \ar[l]^j \ar[d]_g \ar[r]_h & \mathcal{X} \ar[ld]^f \\
& Y
}
$$
with $j$ an open immersion, $\overline{g}$ and $h$ proper,
and such that $|V|$ is contained in the image of $|g|$.
\end{lemma}

\begin{proof}
Suppose we have a commutative diagram
$$
\xymatrix{
\mathcal{X}' \ar[d]_{f'} \ar[r] & \mathcal{X} \ar[d]^f \\
Y' \ar[r] & Y
}
$$
and a quasi-compact open $V' \subset Y'$, such that
$Y' \to Y$ is a proper morphism of algebraic spaces,
$\mathcal{X}' \to \mathcal{X}$ is a proper morphism of algebraic stacks,
$V' \subset Y'$ maps surjectively onto $V$, and
$\mathcal{X}'_{V'}$ is a gerbe over $V'$.
Then it suffices to prove the lemma for the pair
$(f' : \mathcal{X}' \to Y', V')$. Some details omitted.

\medskip\noindent
Overall strategy of the proof. We will reduce
to the case where the image of $f$ is open and $f$
has a section over this open by repeatedly applying the
above remark. Each step is straightforward, but there are
quite a few of them which makes the proof a bit involved.

\medskip\noindent
Using Limits of Spaces, Proposition
\ref{spaces-limits-proposition-there-is-a-scheme-finite-over}
we reduce to the case where $Y$ is a scheme.
(Let $Y' \to Y$ be a finite surjective morphism where $Y'$ is
a scheme. Set $\mathcal{X}' = \mathcal{X}_{Y'}$ and apply
the initial remark of the proof.)

\medskip\noindent
Using Lemma \ref{lemma-flatten-stack}
(and Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-gerbe-fppf}
to see that a gerbe is flat and locally of finite presentation)
we reduce to the case where $f$ is flat and of finite presentation.

\medskip\noindent
Since $f$ is flat and locally of finite
presentation, we see that the image of $|f|$ is an open $W \subset Y$.
Since $\mathcal{X}$ is quasi-compact (as $f$ is of finite type
and $Y$ is quasi-compact) we see that $W$ is quasi-compact.
By Lemma \ref{lemma-finite-cover-factor}
we can find a finite surjective morphism $g : Y' \to Y$
such that $g^{-1}(W) \to Y$ factors Zariski locally
through $\mathcal{X} \to Y$.
After replacing $Y$ by $Y'$ and $\mathcal{X}$ by
$\mathcal{X} \times_Y Y'$ we reduce to the situation
described in the next paragraph.

\medskip\noindent
Assume there exists $n \geq 0$, quasi-compact opens
$W_i \subset Y$, $i = 1, \ldots, n$, and
morphisms $x_i : W_i \to \mathcal{X}$ such that
(a) $f \circ x_i = \text{id}_{W_i}$,
(b) $W = \bigcup_{i = 1, \ldots, n} W_i$ contains $V$, and
(c) $W$ is the image of $|f|$.
We will use induction on $n$. The base case is $n = 0$: this
implies $V = \emptyset$ and in this case we can take
$\overline{Z} = \emptyset$.
If $n > 0$, then for $i = 1, \ldots, n$
consider the reduced closed subschemes
$Y_i$ with underlying topological space
$Y \setminus W_i$. Consider the finite morphism
$$
Y' = Y \amalg \coprod\nolimits_{i = 1, \ldots, n} Y_i \longrightarrow Y
$$
and the quasi-compact open
$$
V' = (W_1 \cap \ldots \cap W_n \cap V) \amalg
\coprod_{i = 1, \ldots, n} (V \cap Y_i).
$$
By the initial remark of the proof, if we can prove the lemma for the pairs
$$
(\mathcal{X} \to Y, W_1 \cap \ldots \cap W_n \cap V)
\quad\text{and}\quad
(\mathcal{X} \times_Y Y_i \to Y_i, V \cap Y_i),\quad
i = 1, \ldots, n
$$
then the result is true. Here we use the settheoretic equality
$V = (W_1 \cap \ldots \cap W_n \cap V) \cup
\bigcup\nolimits_{i = 1, \ldots n} (V \cap Y_i)$.
The induction hypothesis applies to the second type of
pairs above. Hence we reduce to the situation described in
the next paragraph.

\medskip\noindent
Assume there exists $n \geq 0$, quasi-compact opens
$W_i \subset Y$, $i = 1, \ldots, n$, and
morphisms $x_i : W_i \to \mathcal{X}$ such that
(a) $f \circ x_i = \text{id}_{W_i}$,
(b) $W = \bigcup_{i = 1, \ldots, n} W_i$ contains $V$,
(c) $W$ is the image of $|f|$, and
(d) $V \subset W_1 \cap \ldots \cap W_n$.
The morphisms
$$
T_{ij} = \mathit{Isom}_\mathcal{X}(x_i|_{W_i \cap W_j \cap V},
x_j|_{W_i \cap W_j \cap V}) \longrightarrow W_i \cap W_j \cap V
$$
are surjective, flat, and locally of finite presentation
(Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-gerbe-isom-fppf}).
We apply Lemma \ref{lemma-finite-cover-factor}
to each quasi-compact open $W_i \cap W_j \cap V$ and the morphisms
$T_{ij} \to W_i \cap W_j \cap V$ to get finite surjective morphisms
$Y'_{ij} \to Y$. After replacing $Y$ by the fibre product of all
of the $Y'_{ij}$ over $Y$ we reduce to the situation described
in the next paragraph.

\medskip\noindent
Assume there exists $n \geq 0$, quasi-compact opens
$W_i \subset Y$, $i = 1, \ldots, n$, and
morphisms $x_i : W_i \to \mathcal{X}$ such that
(a) $f \circ x_i = \text{id}_{W_i}$,
(b) $W = \bigcup_{i = 1, \ldots, n} W_i$ contains $V$,
(c) $W$ is the image of $|f|$,
(d) $V \subset W_1 \cap \ldots \cap W_n$, and
(e) $x_i$ and $x_j$ are Zariski locally isomorphic over $W_i \cap W_j \cap V$.
Let $y \in V$ be arbitrary.
Suppose that we can find a quasi-compact open neighbourhood
$y \in V_y \subset V$ such that the lemma is true for
the pair $(\mathcal{X} \to Y, V_y)$, say with solution
$\overline{Z}_y, Z_y, \overline{g}_y, g_y, h_y$.
Since $V$ is quasi-compact, we can find a finite number
$y_1, \ldots, y_m$ such that $V = V_{y_1} \cup \ldots \cup V_{y_m}$.
Then it follows that setting
$$
\overline{Z} = \coprod \overline{Z}_{y_j},\quad
Z = \coprod Z_{y_j},\quad
\overline{g} = \coprod \overline{g}_{y_j},\quad
g = \coprod g_{y_j},\quad
h = \coprod h_{y_j}
$$
is a solution for the lemma. Given $y$ by condition (e)
we can choose a quasi-compact open neighbourhood $y \in V_y \subset V$
and isomorphisms $\varphi_i : x_1|_{V_y} \to x_i|_{V_y}$ for
$i = 2, \ldots, n$. Set $\varphi_{ij} = \varphi_j \circ \varphi_i^{-1}$.
This leads us to the situation described in the next paragraph.

\medskip\noindent
Assume there exists $n \geq 0$, quasi-compact opens
$W_i \subset Y$, $i = 1, \ldots, n$, and
morphisms $x_i : W_i \to \mathcal{X}$ such that
(a) $f \circ x_i = \text{id}_{W_i}$,
(b) $W = \bigcup_{i = 1, \ldots, n} W_i$ contains $V$,
(c) $W$ is the image of $|f|$,
(d) $V \subset W_1 \cap \ldots \cap W_n$, and
(f) there are isomorphisms $\varphi_{ij} : x_i|_V \to x_j|_V$
satisfying $\varphi_{jk} \circ \varphi_{ij} = \varphi_{ik}$.
The morphisms
$$
I_{ij} = \mathit{Isom}_\mathcal{X}(x_i|_{W_i \cap W_j},
x_j|_{W_i \cap W_j}) \longrightarrow W_i \cap W_j
$$
are proper because $f$ is separated
(Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-separated-implies-isom}).
Observe that $\varphi_{ij}$ defines a section $V \to I_{ij}$
of $I_{ij} \to W_i \cap W_j$ over $V$.
By More on Morphisms of Spaces, Lemma
\ref{spaces-more-morphisms-lemma-get-section-after-blowup}
we can find $V$-admissible blowups
$p_{ij} : Y_{ij} \to Y$ such that $s_{ij}$
extends to $p_{ij}^{-1}(W_i \cap W_j)$.
After replacing $Y$ by the fibre product of all the $Y_{ij}$
over $Y$ we get to the situation described in the next paragraph.

\medskip\noindent
Assume there exists $n \geq 0$, quasi-compact opens
$W_i \subset Y$, $i = 1, \ldots, n$, and
morphisms $x_i : W_i \to \mathcal{X}$ such that
(a) $f \circ x_i = \text{id}_{W_i}$,
(b) $W = \bigcup_{i = 1, \ldots, n} W_i$ contains $V$,
(c) $W$ is the image of $|f|$,
(d) $V \subset W_1 \cap \ldots \cap W_n$, and
(g) there are isomorphisms
$\varphi_{ij} : x_i|_{W_i \cap W_j} \to x_j|_{W_i \cap W_j}$
satisfying
$$
\varphi_{jk}|_V \circ \varphi_{ij}|_V = \varphi_{ik}|_V.
$$
After replacing $Y$ by another $V$-admissible blowup if necessary
we may assume that $V$ is dense and scheme theoretically dense
in $Y$ and hence in any open subspace of $Y$ containing $V$.
After such a replacement we conclude that
$$
\varphi_{jk}|_{W_i \cap W_j \cap W_k} \circ
\varphi_{ij}|_{W_i \cap W_j \cap W_k} =
\varphi_{ik}|_{W_i \cap W_j \cap W_k}
$$
by appealing to Morphisms of Spaces, Lemma
\ref{spaces-morphisms-lemma-equality-of-morphisms}
and the fact that $I_{ik} \to W_i \cap W_j$ is proper
(hence separated).
Of course this means that $(x_i, \varphi_{ij})$
is a desent datum and we obtain a morphism
$x : W \to \mathcal{X}$ agreeing with $x_i$ over $W_i$
because $\mathcal{X}$ is a stack.
Since $x$ is a section of the separated morphism
$\mathcal{X} \to W$ we see that $x$ is proper
(Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-section-immersion}).
Thus the lemma now holds with $\overline{Z} = Y$,
$Z = W$, $\overline{g} = \text{id}_Y$, $g = \text{id}_W$,
$h = x$.
\end{proof}

\begin{theorem}[Chow's lemma]
\label{theorem-chow-finite-type}
\begin{reference}
This is a result due to Ofer Gabber, see
\cite[Theorem 1.1]{olsson_proper}
\end{reference}
Let $f : \mathcal{X} \to Y$ be a morphism from an algebraic stack
to an algebraic space. Assume
\begin{enumerate}
\item $Y$ is quasi-compact and quasi-separated,
\item $f$ is separated of finite type.
\end{enumerate}
Then there exists a commutative diagram
$$
\xymatrix{
\mathcal{X} \ar[rd] & X \ar[l] \ar[d] \ar[r] & \overline{X} \ar[ld] \\
& Y
}
$$
where $X \to \mathcal{X}$ is proper surjective,
$X \to \overline{X}$ is an open immersion, and
$\overline{X} \to Y$ is proper morphism of algebraic spaces.
\end{theorem}

\begin{proof}
The rough idea is to use that $\mathcal{X}$ has a dense open
which is a gerbe (Morphisms of Stacks, Proposition
\ref{stacks-morphisms-proposition-open-stratum})
and appeal to Lemma \ref{lemma-make-section}.
The reason this does not work is that the open may not be
quasi-compact and one runs into technical problems. Thus
we first do a (standard) reduction to the Noetherian case.

\medskip\noindent
First we choose a closed immersion
$\mathcal{X} \to \mathcal{X}'$ where $\mathcal{X}'$
is an algebraic stack separated and of finite type over $Y$.
See Limits of Stacks, Lemma
\ref{stacks-limits-lemma-separated-closed-in-finite-presentation}.
Clearly it suffices to prove the theorem for
$\mathcal{X}'$, hence we may assume $\mathcal{X} \to Y$
is separated and of finite presentation.

\medskip\noindent
Assume $\mathcal{X} \to Y$ is separated and of finite presentation.
By Limits of Spaces, Proposition \ref{spaces-limits-proposition-approximate}
we can write $Y = \lim Y_i$ as the directed limit of a system
of Noetherian algebraic spaces with affine transition morphisms.
By Limits of Stacks, Lemma \ref{stacks-limits-lemma-descend-a-stack-down}
there is an $i$ and a morphism $\mathcal{X}_i \to Y_i$ of finite presentation
from an algebraic stack to $Y_i$ such that
$\mathcal{X} = Y \times_{Y_i} \mathcal{X}_i$.
After increasing $i$ we may assume that $\mathcal{X}_i \to Y_i$
is separated, see Limits of Stacks, Lemma
\ref{stacks-limits-lemma-eventually-separated}.
Then it suffices to prove the theorem
for $\mathcal{X}_i \to Y_i$. This reduces us to the case discussed
in the next paragraph.

\medskip\noindent
Assume $Y$ is Noetherian. We may replace $\mathcal{X}$ by its
reduction (Properties of Stacks, Definition
\ref{stacks-properties-definition-reduced-induced-stack}).
This reduces us to the case discussed
in the next paragraph.

\medskip\noindent
Assume $Y$ is Noetherian and $\mathcal{X}$ is reduced.
Since $\mathcal{X} \to Y$ is separated and $Y$ quasi-separated,
we see that $\mathcal{X}$ is quasi-separated as an algebraic stack.
Hence the inertia $\mathcal{I}_\mathcal{X} \to \mathcal{X}$
is quasi-compact. Thus by Morphisms of Stacks, Proposition
\ref{stacks-morphisms-proposition-open-stratum}
there exists a dense open substack $\mathcal{V} \subset \mathcal{X}$
which is a gerbe. Let $\mathcal{V} \to V$ be the morphism
which expresses $\mathcal{V}$ as a gerbe over the algebraic space $V$.
See
Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-gerbe-over-iso-classes}
for a construction of $\mathcal{V} \to V$.
This construction in particular shows that the morphism
$\mathcal{V} \to Y$ factors as $\mathcal{V} \to V \to Y$.
Picture
$$
\xymatrix{
\mathcal{V} \ar[r] \ar[d] & \mathcal{X} \ar[d] \\
V \ar[r] & Y
}
$$
Since the morphism $\mathcal{V} \to V$ is surjective, flat, and
of finite presentation
(Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-gerbe-fppf})
and since $\mathcal{V} \to Y$ is locally of finite presentation,
it follows that $V \to Y$ is locally of finite presentation
(Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-flat-finite-presentation-permanence}).
Note that $\mathcal{V} \to V$ is a universal homeomorphism
(Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-gerbe-bijection-points}).
Since $\mathcal{V}$ is quasi-compact (see
Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-locally-closed-in-noetherian})
we see that $V$ is quasi-compact.
Finally, since $\mathcal{V} \to Y$ is separated the same is true
for $V \to Y$ by
Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-check-separated-on-ui-cover}
applied to $\mathcal{V} \to V \to Y$
(whose assumptions are satisfied as we've already seen).

\medskip\noindent
All of the above means that the assumptions of
Limits of Spaces, Lemma \ref{spaces-limits-lemma-embedding-into-affine-over-qs}
apply to the morphism $V \to Y$. Thus we can find a dense open
subspace $V' \subset V$ and an immersion $V' \to \mathbf{P}^n_Y$
over $Y$. Clearly we may replace $V$ by $V'$ and $\mathcal{V}$
by the inverse image of $V'$ in $\mathcal{V}$ (recall that
$|\mathcal{V}| = |V|$ as we've seen above).
Thus we may assume we have a diagram
$$
\xymatrix{
\mathcal{V} \ar[rr] \ar[d] & & \mathcal{X} \ar[d] \\
V \ar[r] & \mathbf{P}^n_Y \ar[r] & Y
}
$$
where the arrow $V \to \mathbf{P}^n_Y$ is an immersion.
Let $\mathcal{X}'$ be the scheme theoretic image of the morphism
$$
j : \mathcal{V} \longrightarrow \mathbf{P}^n_Y \times_Y \mathcal{X}
$$
and let $Y'$ be the scheme theoretic image of the morphism
$V \to \mathbf{P}^n_Y$. We obtain a commutative diagram
$$
\xymatrix{
\mathcal{V} \ar[r] \ar[d] &
\mathcal{X}' \ar[r] \ar[d] &
\mathbf{P}^n_Y \times_Y \mathcal{X} \ar[d] \ar[r] &
\mathcal{X} \ar[d] \\
V \ar[r] &
Y' \ar[r] &
\mathbf{P}^n_Y \ar[r] &
Y
}
$$
(See Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-factor-factor}).
We claim that $\mathcal{V} = V \times_{Y'} \mathcal{X}'$ and that
Lemma \ref{lemma-make-section} applies to the morphism $\mathcal{X}' \to Y'$
and the open subspace $V \subset Y'$. If the claim is true, then we obtain
$$
\xymatrix{
\overline{X} \ar[rd]_{\overline{g}} &
X \ar[l] \ar[d]_g \ar[r]_h & \mathcal{X}' \ar[ld]^f \\
& Y'
}
$$
with $X \to \overline{X}$ an open immersion, $\overline{g}$ and $h$ proper,
and such that $|V|$ is contained in the image of $|g|$.
Then the composition $X \to \mathcal{X}' \to \mathcal{X}$ is
proper (as a composition of proper morphisms) and its image
contains $|\mathcal{V}|$, hence this composition is surjective.
As well, $\overline{X} \to Y' \to Y$ is proper as a composition
of proper morphisms.

\medskip\noindent
The last step is to prove the claim.
Observe that $\mathcal{X}' \to Y'$ is separated and of finite type,
that $Y'$ is quasi-compact and quasi-separated, and that $V$ is quasi-compact
(we omit checking all the details completely).
Next, we observe that
$b : \mathcal{X}' \to \mathcal{X}$ is an isomorphism over
$\mathcal{V}$ by Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-scheme-theoretic-image-of-partial-section}.
In particular $\mathcal{V}$ is identified with an open substack
of $\mathcal{X}'$.
The morphism $j$ is quasi-compact
(source is quasi-compact and target is quasi-separated), so formation
of the scheme theoretic image of $j$ commutes with flat base change by
Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-existence-plus-flat-base-change}.
In particular we see that $V \times_{Y'} \mathcal{X}'$ is the
scheme theoretic image of
$\mathcal{V} \to V \times_{Y'} \mathcal{X}'$.
However, by Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-universally-closed-permanence}
the image of $|\mathcal{V}| \to |V \times_{Y'} \mathcal{X}'|$
is closed (use that $\mathcal{V} \to V$ is a universal homeomorphism
as we've seen above and hence is universally closed).
Also the image is dense (combine what we just said with
Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-topology-scheme-theoretic-image})
we conclude $|\mathcal{V}| = |V \times_{Y'} \mathcal{X}'|$.
Thus $\mathcal{V} \to V \times_{Y'} \mathcal{X}'$ is an
isomorphism and the proof of the claim is complete.
\end{proof}




\section{Noetherian valuative criterion}
\label{section-Noetherian-valuative-criterion}

\noindent
In this section we will discuss (refined) valuative criteria for
morphisms of algebraic stacks using only discrete valuation rings
in the Noetherian setting. There are many different variants
and we will add more here over time as needed.

\medskip\noindent
Let $f : \mathcal{X} \to \mathcal{Y}$ be a morphism of algebraic stacks
(or algebraic spaces or schemes). A {\it refined} valuative criterion
is one where we are given a morphism $\mathcal{U} \to \mathcal{X}$
(with some properties) and we only look at existence or uniqueness
of dotted arrows in solid diagrams of the form
$$
\xymatrix{
\Spec(K) \ar[d] \ar[r] & \mathcal{U} \ar[r] & \mathcal{X} \ar[d] \\
\Spec(A) \ar[rr] \ar@{..>}[rru] & & \mathcal{Y}
}
$$
We use this terminology below to describe the results we have obtained sofar.

\medskip\noindent
Non-Noetherian valuative criteria for morphisms of algebraic stacks
\begin{enumerate}
\item Morphisms of Stacks, Section
\ref{stacks-morphisms-section-valuative-second}
(for separatedness of the diagonal),
\item Morphisms of Stacks, Section
\ref{stacks-morphisms-section-valuative-diagonal}
(for separatedness),
\item Morphisms of Stacks, Section
\ref{stacks-morphisms-section-valutive-criterion}
(for universal closedness),
\item Morphisms of Stacks, Section
\ref{stacks-morphisms-section-valutive-criterion-properness}
(for properness).
\end{enumerate}
For algebraic spaces we have the following valuative criteria
\begin{enumerate}
\item Morphisms of Spaces, Section
\ref{spaces-morphisms-section-valuative-criterion-universally-closed}
(for universal closedness),
\item Morphisms of Spaces, Lemma
\ref{spaces-morphisms-lemma-refined-valuative-criterion-universally-closed}
(refined for universal closedness)
\item Morphisms of Spaces, Section
\ref{spaces-morphisms-section-valuative-separatedness}
(for separatedness),
\item Morphisms of Spaces, Section
\ref{spaces-morphisms-section-valuative-criterion-properness}
(for properness),
\item Decent Spaces, Section
\ref{decent-spaces-section-valuative-criterion-universally-closed}
(for universal closedness for decent spaces),
\item Decent Spaces, Lemma
\ref{decent-spaces-lemma-re-characterize-universally-closed}
(for universal closedness for decent morphisms between algebraic spaces),
\item Cohomology of Spaces, Section
\ref{spaces-cohomology-section-Noetherian-valuative-criterion}
contains Noetherian valuative criteria
\begin{enumerate}
\item Cohomology of Spaces, Lemma
\ref{spaces-cohomology-lemma-check-separated-dvr}
(for separatedness using discrete valuation rings),
\item Cohomology of Spaces, Lemma
\ref{spaces-cohomology-lemma-check-proper-dvr}
(for properness using discrete valuation rings),
\item Cohomology of Spaces, Remark
\ref{spaces-cohomology-remark-variant}
(discusses how to reduce to complete discrete valuation rings),
\end{enumerate}
\item Limits of Spaces, Section
\ref{spaces-limits-section-Noetherian-valuative-criterion}
discussing Noetherian valuative criteria
\begin{enumerate}
\item Limits of Spaces, Lemma
\ref{spaces-limits-lemma-Noetherian-dvr-valuative-separation}
(for separatedness using discrete valuation rings and generic points)
\item Limits of Spaces, Lemma
\ref{spaces-limits-lemma-Noetherian-dvr-valuative-proper}
(for properness using discrete valuation rings and generic points)
\item Limits of Spaces, Lemma
\ref{spaces-limits-lemma-check-universally-closed-Noetherian}
(for universal closedness using discrete valuation rings).
\end{enumerate}
\item Limits of Spaces, Section
\ref{spaces-limits-section-refined-valuative-criteria}
discussing refined Noetherian valuative criteria
\begin{enumerate}
\item Limits of Spaces, Lemmas
\ref{spaces-limits-lemma-refined-valuative-criterion-proper} and
\ref{spaces-limits-lemma-refined-valuative-criterion-universally-closed}
(refined for properness using discrete valuation rings),
\item Limits of Spaces, Lemma
\ref{spaces-limits-lemma-refined-valuative-criterion-separated}
(refined for separatedness using discrete valuation rings),
\end{enumerate}
\end{enumerate}
For schemes we have the following valuative criteria
\begin{enumerate}
\item Schemes, Section
\ref{schemes-section-valuative-criterion-universal-closedness}
(for universal closedness)
\item Schemes, Section \ref{schemes-section-valuative-separatedness}
(for separatedness),
\item Morphisms, Section \ref{morphisms-section-valuative-criteria}
(for properness)
\item Morphisms, Lemma
\ref{morphisms-lemma-refined-valuative-criterion-universally-closed}
(refined for universal closedness),
\item Limits, Section \ref{limits-section-Noetherian-valuative-criterion}
discussing Noetherian valuative criteria
\begin{enumerate}
\item Limits, Lemma \ref{limits-lemma-Noetherian-dvr-valuative-separation}
(for separatedness using discrete valuation rings and generic points)
\item Limits, Lemma \ref{limits-lemma-Noetherian-dvr-valuative-proper}
(for properness using discrete valuation rings and generic points)
\item Limits, Lemma \ref{limits-lemma-check-universally-closed-Noetherian}
(for universal closedness using discrete valuation rings).
\end{enumerate}
\item Limits, Section \ref{limits-section-refined-valuative-criteria}
discussing refined Noetherian valuative criteria
\begin{enumerate}
\item Limits, Lemmas
\ref{limits-lemma-refined-valuative-criterion-proper} and
\ref{limits-lemma-refined-valuative-criterion-universally-closed}
(refined for properness using discrete valuation rings),
\item Limits, Lemma \ref{limits-lemma-refined-valuative-criterion-separated}
(refined for separatedness using discrete valuation rings),
\end{enumerate}
\item Limits, Section \ref{limits-section-nagata-valuative}
discussing valuative criteria over a Noetherian base where
one can get discrete valuation rings essentially of finite type
over the base.
\end{enumerate}
This ends our list of previous results.

\medskip\noindent
Many of the results in this section can (and perhaps should)
be proved by appealing to the following lemma, although we have not
always done so.

\begin{lemma}
\label{lemma-reach-point-closure-Noetherian}
Let $f : \mathcal{X} \to \mathcal{Y}$ be a morphism of algebraic stacks.
Assume $f$ finite type and $\mathcal{Y}$ locally Noetherian.
Let $y \in |\mathcal{Y}|$ be a point in the closure of the image of $|f|$.
Then there exists a commutative diagram
$$
\xymatrix{
\Spec(K) \ar[r] \ar[d] & \mathcal{X} \ar[d]^f \\
\Spec(A) \ar[r] & \mathcal{Y}
}
$$
of algebraic stacks where $A$ is a discrete valuation ring and $K$
is its field of fractions mapping the closed point of $\Spec(A)$ to $y$.
\end{lemma}

\begin{proof}
Choose an affine scheme $V$, a point $v \in V$ and a smooth morphism
$V \to \mathcal{Y}$ mapping $v$ to $y$. The map $|V| \to |\mathcal{Y}|$
is open and by
Properties of Stacks, Lemma \ref{stacks-properties-lemma-points-cartesian}
the image of $|\mathcal{X} \times_\mathcal{Y} V| \to |V|$
is the inverse image of the image of $|f|$.
We conclude that the point $v$ is in the closure of the
image of $|\mathcal{X} \times_\mathcal{Y} V| \to |V|$.
If we prove the lemma for
$\mathcal{X} \times_\mathcal{Y} V \to V$ and the point $v$, then
the lemma follows for $f$ and $y$.
In this way we reduce to the situation described in the
next paragraph.

\medskip\noindent
Assume we have $f : \mathcal{X} \to Y$ and $y \in |Y|$ as in the lemma where
$Y$ is a Noetherian affine scheme. Since $f$ is quasi-compact, we conclude that
$\mathcal{X}$ is quasi-compact. Hence we can choose an affine scheme $W$ and
a surjective smooth morphism $W \to \mathcal{X}$. Then the image of
$|f|$ is the same as the image of $|W| \to |Y|$. In this way we reduce
to the case of schemes which is
Limits, Lemma \ref{limits-lemma-reach-point-closure-Noetherian}.
\end{proof}

\begin{lemma}
\label{lemma-check-separated-dvr}
Let $f : \mathcal{X} \to \mathcal{Y}$ be a morphism of algebraic stacks. Assume
\begin{enumerate}
\item $\mathcal{Y}$ is locally Noetherian,
\item $f$ is locally of finite type and quasi-separated,
\item for every commutative diagram
$$
\xymatrix{
\Spec(K) \ar[r]_x \ar[d]_j & \mathcal{X} \ar[d]^f \\
\Spec(A) \ar[r]^y \ar@{-->}[ru] & \mathcal{Y}
}
$$
where $A$ is a discrete valuation ring and $K$ its fraction field
and any $2$-arrow $\gamma : y \circ j \to f \circ x$ the category
of dotted arrows (Morphisms of Stacks, Definition
\ref{stacks-morphisms-definition-fill-in-diagram})
is either empty or a setoid with exactly one isomorphism class.
\end{enumerate}
Then $f$ is separated.
\end{lemma}

\begin{proof}
To prove that $f$ is separated we have to show that
$\Delta : \mathcal{X} \to \mathcal{X} \times_\mathcal{Y} \mathcal{X}$
is proper. We already know that $\Delta$ is representable by
algebraic spaces, locally of finite type (Morphisms of Stacks,
Lemma \ref{stacks-morphisms-lemma-properties-diagonal}) and
quasi-compact and quasi-separated (by definition of $f$ being quasi-separated).
Choose a scheme $U$ and a surjective smooth morphism
$U \to \mathcal{X} \times_\mathcal{Y} \mathcal{X}$.
Set
$$
V = \mathcal{X} \times_{\Delta, \mathcal{X} \times_\mathcal{Y} \mathcal{X}} U
$$
It suffices to show that the morphism of algebraic spaces $V \to U$
is proper (Properties of Stacks, Lemma
\ref{stacks-properties-lemma-check-property-covering}).
Observe that $U$ is locally Noetherian
(use Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-locally-finite-type-locally-noetherian}
and the fact that $U \to \mathcal{Y}$ is locally of finite type)
and $V \to U$
is of finite type and quasi-separated (as the base change
of $\Delta$ and properties of $\Delta$ listed above). Applying
Cohomology of Spaces, Lemma \ref{spaces-cohomology-lemma-check-proper-dvr}
it suffices to show: Given a commutative diagram
$$
\xymatrix{
\Spec(K) \ar[r]_v \ar[d]_j &
V \ar[d]^g \ar[r] &
\mathcal{X} \ar[d]^\Delta \\
\Spec(A) \ar[r]^u \ar@{-->}[ru] \ar@{..>}[rru] &
U \ar[r] &
\mathcal{X} \times_\mathcal{Y} \mathcal{X}
}
$$
where $A$ is a discrete valuation ring and $K$ its fraction field,
there is a unique dashed arrow making the diagram commute.
By Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-cat-dotted-arrows-base-change}
the categories of dashed and dotted arrows are equivalent.
Assumption (3) implies there is a unique dotted arrow up to
isomorphism, see Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-helper-diagonal}. We conclude
there is a unique dashed arrow as desired.
\end{proof}

\begin{lemma}
\label{lemma-refined-valuative-criterion-proper}
Let $f : \mathcal{X} \to \mathcal{Y}$ and $h : \mathcal{U} \to \mathcal{X}$
be morphisms of algebraic stacks. Assume that $\mathcal{Y}$ is
locally Noetherian, that $f$ and $h$ are of finite type,
that $f$ is separated, and that the image of
$|h| : |\mathcal{U}| \to |\mathcal{X}|$ is dense in $|\mathcal{X}|$.
If given any $2$-commutative diagram
$$
\xymatrix{
\Spec(K) \ar[r]_-u \ar[d]_j & \mathcal{U} \ar[r]_h & \mathcal{X} \ar[d]^f \\
\Spec(A) \ar[rr]^-y & & \mathcal{Y}
}
$$
where $A$ is a discrete valuation ring with field of fractions $K$
and $\gamma : y \circ j \to f \circ h \circ u$ there
exist an extension $K'/K$ of fields, a valuation ring $A' \subset K'$
dominating $A$ such that the category of dotted arrows for the
induced diagram
$$
\xymatrix{
\Spec(K') \ar[r]_-{x'} \ar[d]_{j'} & \mathcal{X} \ar[d]^f \\
\Spec(A') \ar[r]^-{y'} \ar@{..>}[ru] & \mathcal{Y}
}
$$
with induced $2$-arrow $\gamma' : y' \circ j' \to f \circ x'$
is nonempty (Morphisms of Stacks, Definition
\ref{stacks-morphisms-definition-fill-in-diagram}), then $f$ is proper.
\end{lemma}

\begin{proof}
It suffices to prove that $f$ is universally closed.
Let $V \to \mathcal{Y}$ be a smooth morphism where $V$ is an affine scheme.
By Properties of Stacks, Lemma
\ref{stacks-properties-lemma-points-cartesian}
the image $I$ of
$|\mathcal{U} \times_\mathcal{Y} V| \to |\mathcal{X} \times_\mathcal{Y} V|$
is the inverse image of the image of $|h|$. Since
$|\mathcal{X} \times_\mathcal{Y} V| \to |\mathcal{X}|$ is open
(Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-fppf-open})
we conclude that $I$ is dense in $|\mathcal{X} \times_\mathcal{Y} V|$.
Also since the category of dotted arrows behaves well with respect
to base change (Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-cat-dotted-arrows-base-change})
the assumption on existence of dotted arrows (after extension)
is inherited by the morphisms
$\mathcal{U} \times_\mathcal{Y} V \to \mathcal{X} \times_\mathcal{Y} V \to V$.
Therefore the assumptions of the lemma are
satisfied for the morphisms
$\mathcal{U} \times_\mathcal{Y} V \to \mathcal{X} \times_\mathcal{Y} V \to V$.
Hence we may assume $\mathcal{Y}$ is an affine scheme.

\medskip\noindent
Assume $\mathcal{Y} = Y$ is an affine scheme.
(From now on we no longer have to worry about the
$2$-arrows $\gamma$ and $\gamma'$, see Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-cat-dotted-arrows-independent}.)
Then $\mathcal{U}$ is quasi-compact. Choose an affine scheme $U$ and a
surjective smooth morphism $U \to \mathcal{U}$.
Then we may and do replace $\mathcal{U}$ by $U$.
Thus we may assume that $\mathcal{U}$ is an affine scheme.

\medskip\noindent
Assume $\mathcal{Y} = Y$ and $\mathcal{U} = U$ are affine schemes.
By Chow's lemma (Theorem \ref{theorem-chow-finite-type})
we can choose a surjective proper morphism $X \to \mathcal{X}$
where $X$ is an algebraic space. We will use below that $X \to Y$ is separated
as a composition of separated morphisms. Consider the
algebraic space $W = X \times_\mathcal{X} U$. The projection morphism
$W \to X$ is of finite type.
We may replace $X$ by the scheme theoretic image of
$W \to X$ and hence we may assume that the image of $|W|$ in $|X|$
is dense in $|X|$ (here we use that the image of $|h|$
is dense in $|\mathcal{X}|$, so after this replacement, the
morphism $X \to \mathcal{X}$ is still surjective).
We claim that for every solid commutative diagram
$$
\xymatrix{
\Spec(K) \ar[r] \ar[d] & W \ar[r] & X \ar[d] \\
\Spec(A) \ar[rr] \ar@{..>}[rru] & & Y
}
$$
where $A$ is a discrete valuation ring with field of fractions $K$, there
exists a dotted arrow making the diagram commute. First, it is enough to
prove there exists a dotted arrow after replacing $K$ by an extension
and $A$ by a valuation ring in this extension dominating $A$, see
Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-push-down-solution}.
By the assumption of the lemma we get an extension $K'/K$ and a valuation
ring $A' \subset K'$ dominating $A$ and
an arrow $\Spec(A') \to \mathcal{X}$ lifting the composition
$\Spec(A') \to \Spec(A) \to Y$ and compatible with the composition
$\Spec(K') \to \Spec(K) \to W \to X$. Because $X \to \mathcal{X}$
is proper, we can use the valuative criterion of properness
(Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-criterion-proper})
to find an extension $K''/K'$ and a valuation ring $A'' \subset K''$
dominating $A'$ and a morphism $\Spec(A'') \to X$ lifting the composition
$\Spec(A'') \to \Spec(A') \to \mathcal{X}$ and compatible with the composition
$\Spec(K'') \to \Spec(K') \to \Spec(K) \to X$.
Then $K''/K$ and $A'' \subset K''$ and the morphism $\Spec(A'') \to X$
is a solution to the problem posed above and the claim holds.

\medskip\noindent
The claim implies the morphism $X \to Y$ is proper by the
case of the lemma for algebraic spaces
(Limits of Spaces, Lemma
\ref{spaces-limits-lemma-refined-valuative-criterion-proper}).
By Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-image-proper-is-proper}
we conclude that $\mathcal{X} \to Y$ is proper as desired.
\end{proof}

\begin{lemma}
\label{lemma-refined-valuative-criterion-separated}
Let $f : \mathcal{X} \to \mathcal{Y}$ and $h : \mathcal{U} \to \mathcal{X}$
be morphisms of algebraic stacks. Assume that $\mathcal{Y}$ is
locally Noetherian, that $f$ is locally of finite type and quasi-separated,
that $h$ is of finite type, and that the image of
$|h| : |\mathcal{U}| \to |\mathcal{X}|$ is dense in $|\mathcal{X}|$.
If given any $2$-commutative diagram
$$
\xymatrix{
\Spec(K) \ar[r]_-u \ar[d]_j & \mathcal{U} \ar[r]_h & \mathcal{X} \ar[d]^f \\
\Spec(A) \ar[rr]^-y \ar@{..>}[rru] & & \mathcal{Y}
}
$$
where $A$ is a discrete valuation ring with field of fractions $K$
and $\gamma : y \circ j \to f \circ h \circ u$, the category
of dotted arrows is either empty or a setoid with exactly
one isomorphism class, then $f$ is separated.
\end{lemma}

\begin{proof}
We have to prove $\Delta$ is a proper morphism.
Assume first that $\Delta$ is separated. Then we may apply
Lemma \ref{lemma-refined-valuative-criterion-proper}
to the morphisms $\mathcal{U} \to \mathcal{X}$ and
$\Delta : \mathcal{X} \to \mathcal{X} \times_\mathcal{Y} \mathcal{X}$.
Observe that $\Delta$ is quasi-compact as $f$ is quasi-separated.
Of course $\Delta$ is locally of finite type (true for any
diagonal morphism, see Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-properties-diagonal}).
Finally, suppose given a $2$-commutative diagram
$$
\xymatrix{
\Spec(K) \ar[r]_-u \ar[d]_j &
\mathcal{U} \ar[r]_h &
\mathcal{X} \ar[d]^\Delta \\
\Spec(A) \ar[rr]^-y \ar@{..>}[rru] & &
\mathcal{X} \times_\mathcal{Y} \mathcal{X}
}
$$
where $A$ is a discrete valuation ring with field of fractions $K$
and $\gamma : y \circ j \to \Delta \circ h \circ u$.
By Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-helper-diagonal}
and the assumption in the lemma
we find there exists a unique dotted arrow.
This proves the last assumption of
Lemma \ref{lemma-refined-valuative-criterion-proper}
holds and the result follows.

\medskip\noindent
In the general case, it suffices to prove $\Delta$ is separated
since then we'll be back in the previous case. In fact, we claim
that the assumptions of the lemma hold for
$$
\mathcal{U} \to \mathcal{X}
\quad\text{and}\quad
\Delta :
\mathcal{X} \to
\mathcal{X} \times_\mathcal{Y} \mathcal{X}
$$
Namely, since $\Delta$ is representable by algebraic spaces, the
category of dotted arrows for a diagram as in the previous paragraph
is a setoid (see for example
Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-cat-dotted-arrows}).
The argument in the preceding paragraph shows these categories
are either empty or have one isomorphism class.
Thus $\Delta$ is separated.
\end{proof}

\begin{lemma}
\label{lemma-valuative-criterion-universally-closed}
Let $f : \mathcal{X} \to \mathcal{Y}$ be a morphism of algebraic stacks.
Assume that $\mathcal{Y}$ is locally Noetherian and that $f$ is of finite type.
If given any $2$-commutative diagram
$$
\xymatrix{
\Spec(K) \ar[r]_-x \ar[d]_j & \mathcal{X} \ar[d]^f \\
\Spec(A) \ar[r]^-y & \mathcal{Y}
}
$$
where $A$ is a discrete valuation ring with field of fractions $K$
and $\gamma : y \circ j \to f \circ x$ there exist an extension $K'/K$
of fields, a valuation ring $A' \subset K'$ dominating $A$ such that
the category of dotted arrows for the induced diagram
$$
\xymatrix{
\Spec(K') \ar[r]_-{x'} \ar[d]_{j'} & \mathcal{X} \ar[d]^f \\
\Spec(A') \ar[r]^-{y'} \ar@{..>}[ru] & \mathcal{Y}
}
$$
with induced $2$-arrow $\gamma' : y' \circ j' \to f \circ x'$
is nonempty (Morphisms of Stacks, Definition
\ref{stacks-morphisms-definition-fill-in-diagram}), then $f$ is
universally closed.
\end{lemma}

\begin{proof}
Let $V \to \mathcal{Y}$ be a smooth morphism where $V$ is an affine scheme.
The category of dotted arrows behaves well with respect to base change
(Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-cat-dotted-arrows-base-change}).
Hence the assumption on existence of dotted arrows (after extension)
is inherited by the morphism $\mathcal{X} \times_\mathcal{Y} V \to V$.
Therefore the assumptions of the lemma are satisfied for the morphism
$\mathcal{X} \times_\mathcal{Y} V \to V$.
Hence we may assume $\mathcal{Y}$ is an affine scheme.

\medskip\noindent
Assume $\mathcal{Y} = Y$ is a Noetherian affine scheme.
(From now on we no longer have to worry about the
$2$-arrows $\gamma$ and $\gamma'$, see Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-cat-dotted-arrows-independent}.)
To prove that $f$ is universally closed it suffices to show that
$|\mathcal{X} \times \mathbf{A}^n| \to |Y \times \mathbf{A}^n|$ is closed
for all $n$ by Limits of Stacks, Lemma
\ref{stacks-limits-lemma-test-universally-closed}. Since the assumption
in the lemma is inherited by the product morphism
$\mathcal{X} \times \mathbf{A}^n \to Y \times \mathbf{A}^n$ (details omitted)
we reduce to proving that $|\mathcal{X}| \to |Y|$ is closed.

\medskip\noindent
Assume $Y$ is a Noetherian affine scheme.
Let $T \subset |\mathcal{X}|$ be a closed subset. We have to show that
the image of $T$ in $|Y|$ is closed. We may replace $\mathcal{X}$
by the reduced induced closed subspace structure on $T$; we
omit the verification that property on the existence of
dotted arrows is preserved by this replacement.
Thus we reduce to proving that the image
of $|\mathcal{X}| \to |Y|$ is closed.

\medskip\noindent
Let $y \in |Y|$ be a point in the closure of the image of
$|\mathcal{X}| \to |Y|$. By Lemma \ref{lemma-reach-point-closure-Noetherian}
we may choose a commutative diagram
$$
\xymatrix{
\Spec(K) \ar[r] \ar[d] & \mathcal{X} \ar[d]^f \\
\Spec(A) \ar[r] & Y
}
$$
where $A$ is a discrete valuation ring and $K$ is its field of fractions
mapping the closed point of $\Spec(A)$ to $y$. It follows immediately
from the assumption in the lemma that $y$ is in the image of
$|\mathcal{X}| \to |Y|$ and the proof is complete.
\end{proof}










\section{Moduli spaces}
\label{section-moduli-spaces}

\noindent
This section discusses morphisms $f : \mathcal{X} \to Y$ from
algebraic stacks to algebraic spaces. Under suitable hypotheses
$Y$ is called a {\it moduli space} for $\mathcal{X}$. If
$\mathcal{X} = [U/R]$ is a presentation, then we obtain an
$R$-invariant morphism $U \to Y$ and (under suitable hypotheses)
$Y$ is a {\it quotient} of the groupoid $(U, R, s, t, c)$.
A discussion of the different types of quotients can be found
starting with
Quotients of Groupoids, Section \ref{groupoids-quotients-section-introduction}.

\begin{definition}
\label{definition-categorical-quotient}
Let $\mathcal{X}$ be an algebraic stack. Let
$f : \mathcal{X} \to Y$ be a morphism to an algebraic space $Y$.
\begin{enumerate}
\item We say $f$ is a {\it categorical moduli space} if any morphism
$\mathcal{X} \to W$ to an algebraic space $W$ factors uniquely through $f$.
\item We say $f$ is a {\it uniform categorical moduli space}
if for any flat morphism $Y' \to Y$ of algebraic spaces the base change
$f' : Y' \times_Y \mathcal{X} \to Y'$ is a categorical moduli space.
\end{enumerate}
Let $\mathcal{C}$ be a full subcategory of the category of algebraic
spaces.
\begin{enumerate}
\item[(3)] We say $f$ is a {\it categorical moduli space in $\mathcal{C}$}
if $Y \in \Ob(\mathcal{C})$ and any morphism $\mathcal{X} \to W$ with
$W \in \Ob(\mathcal{C})$ factors uniquely through $f$.
\item[(4)] We say is a {\it uniform categorical moduli space in $\mathcal{C}$}
if $Y \in \Ob(\mathcal{C})$ and for every flat morphism $Y' \to Y$ in
$\mathcal{C}$ the base change $f' : Y' \times_Y \mathcal{X} \to Y'$ is a
categorical moduli space in $\mathcal{C}$.
\end{enumerate}
\end{definition}

\noindent
By the Yoneda lemma a categorical moduli space, if it exists, is unique.
Let us match this with the language introduced for quotients.

\begin{lemma}
\label{lemma-quotient-compare}
Let $(U, R, s, t, c)$ be a groupoid in algebraic spaces with
$s, t : R \to U$ flat and locally of finite presentation.
Consider the algebraic stack $\mathcal{X} = [U/R]$.
Given an algebraic space $Y$ there is a $1$-to-$1$ correspondence between
morphisms $f : \mathcal{X} \to Y$ and $R$-invariant morphisms
$\phi : U \to Y$.
\end{lemma}

\begin{proof}
Criteria for Representability, Theorem
\ref{criteria-theorem-flat-groupoid-gives-algebraic-stack}
tells us $\mathcal{X}$ is an algebraic stack.
Given a morphism $f : \mathcal{X} \to Y$ we let $\phi : U \to Y$ be
the composition $U \to \mathcal{X} \to Y$. Since $R = U \times_\mathcal{X} U$
(Groupoids in Spaces, Lemma
\ref{spaces-groupoids-lemma-quotient-stack-2-cartesian})
it is immediate that $\phi$ is $R$-invariant.
Conversely, if $\phi : U \to Y$ is an $R$-invariant morphism towards
an algebraic space, we obtain a morphism
$f : \mathcal{X} \to Y$ by
Groupoids in Spaces, Lemma
\ref{spaces-groupoids-lemma-quotient-stack-2-coequalizer}.
You can also construct $f$ from $\phi$ using the explicit description of
the quotient stack in
Groupoids in Spaces, Lemma
\ref{spaces-groupoids-lemma-quotient-stack-objects}.
\end{proof}

\begin{lemma}
\label{lemma-categorical-quotient-compare}
With assumption and notation as in Lemma \ref{lemma-quotient-compare}.
Then $f$ is a (uniform) categorical moduli space
if and only if $\phi$ is a (uniform) categorical quotient.
Similarly for moduli spaces in a full subcategory.
\end{lemma}

\begin{proof}
It is immediate from the $1$-to-$1$ correspondence established in
Lemma \ref{lemma-quotient-compare} that $f$ is a categorical moduli space
if and only if $\phi$ is a categorical quotient
(Quotients of Groupoids, Definition
\ref{groupoids-quotients-definition-categorical}).
If $Y' \to Y$ is a morphism, then
$U' = Y' \times_Y U \to Y' \times_Y \mathcal{X} = \mathcal{X}'$
is a surjective, flat, locally finitely presented morphism
as a base change of $U \to \mathcal{X}$
(Criteria for Representability, Lemma
\ref{criteria-lemma-flat-quotient-flat-presentation}).
And $R' = Y' \times_Y R$ is equal to $U' \times_{\mathcal{X}'} U'$
by transitivity of fibre products.
Hence $\mathcal{X}' = [U'/R']$, see
Algebraic Stacks, Remark \ref{algebraic-remark-flat-fp-presentation}.
Thus the base change of our situation to $Y'$ is another situation
as in the statement of the lemma. From this it immediately
follows that $f$ is a uniform categorical moduli space
if and only if $\phi$ is a uniform categorical quotient.
\end{proof}

\begin{lemma}
\label{lemma-check-uniform-categorical-quotient-on-affines}
Let $f : \mathcal{X} \to Y$ be a morphism from an algebraic stack
to an algebraic space. If for every affine scheme $Y'$ and flat
morphism $Y' \to Y$ the base change
$f' : Y' \times_Y \mathcal{X} \to Y'$ is a categorical moduli space,
then $f$ is a uniform categorical moduli space.
\end{lemma}

\begin{proof}
Choose an \'etale covering $\{Y_i \to Y\}$ where $Y_i$ is an affine scheme.
For each $i$ and $j$ choose a affine open covering
$Y_i \times_Y Y_j = \bigcup Y_{ijk}$.
Set $\mathcal{X}_i = Y_i \times_Y \mathcal{X}$ and
$\mathcal{X}_{ijk} = Y_{ijk} \times_Y \mathcal{X}$.
Let $g : \mathcal{X} \to W$ be a morphism towards
an algebraic space. Then we consider the diagram
$$
\xymatrix{
\mathcal{X}_i \ar[r] \ar[d] & \mathcal{X} \ar[d] \ar[r]_g & W \\
Y_i \ar[r] \ar@{..>}[rru] & Y
}
$$
The assumption that $\mathcal{X}_i \to Y_i$ is a categorical moduli
space, produces a unique dotted arrow $h_i : Y_i \to W$.
The assumption that $\mathcal{X}_{ijk} \to Y_{ijk}$ is a categorical
moduli space, implies the restriction of $h_i$ and $h_j$ to
$Y_{ijk}$ are equal. Hence $h_i$ and $h_j$ agree on $Y_i \times_Y Y_j$.
Since $Y = \coprod Y_i / \coprod Y_i \times_Y Y_j$
(by Spaces, Section \ref{spaces-section-presentations}) we conclude
that there is a unique morphism $Y \to W$ through which $g$ factors.
Thus $f$ is a categorical moduli space. The same argument applies
after a flat base change, hence $f$ is a uniform categorical moduli space.
\end{proof}







\section{The Keel-Mori theorem}
\label{section-Keel-Mori}

\noindent
In this section we start discussing the theorem of Keel and Mori
in the setting of algebraic stacks. For a discussion of the
literature, please see Guide to Literature, Subsection
\ref{guide-subsection-coarse-moduli-spaces}.

\begin{definition}
\label{definition-well-nigh-affine}
Let $\mathcal{X}$ be an algebraic stack. We say $\mathcal{X}$
is {\it well-nigh affine} if there exists an affine scheme $U$
and a surjective, flat, finite, and finitely presented morphism
$U \to \mathcal{X}$.
\end{definition}

\noindent
We give this property a somewhat ridiculous name because we do not intend to
use it too much.

\begin{lemma}
\label{lemma-well-nigh-affine}
Let $\mathcal{X}$ be an algebraic stack. The following are equivalent
\begin{enumerate}
\item $\mathcal{X}$ is well-nigh affine, and
\item there exists a groupoid scheme $(U, R, s, t, c)$ with $U$ and
$R$ affine and $s, t : R \to U$ finite locally free such that
$\mathcal{X} = [U/R]$.
\end{enumerate}
If true then $\mathcal{X}$ is quasi-compact, quasi-DM, and separated.
\end{lemma}

\begin{proof}
Assume $\mathcal{X}$ is well-nigh affine. Choose an affine scheme $U$
and a surjective, flat, finite, and finitely presented morphism
$U \to \mathcal{X}$. Set $R = U \times_\mathcal{X} U$. Then we
obtain a groupoid $(U, R, s, t, c)$ in algebraic spaces and an
isomorphism $[U/R] \to \mathcal{X}$, see
Algebraic Stacks, Lemma \ref{algebraic-lemma-map-space-into-stack}
and Remark \ref{algebraic-remark-flat-fp-presentation}.
Since $s, t : R \to U$ are 
flat, finite, and finitely presented morphisms
(as base changes of $U \to \mathcal{X})$ we see that
$s, t$ are finite locally free
(Morphisms, Lemma \ref{morphisms-lemma-finite-flat}).
This implies that $R$ is affine (as finite morphisms are affine)
and hence (2) holds.

\medskip\noindent
Suppose that we have a groupoid scheme $(U, R, s, t, c)$ with $U$ and
$R$ are affine and $s, t : R \to U$ finite locally free.
Set $\mathcal{X} = [U/R]$. Then $\mathcal{X}$ is an algebraic stack
by Criteria for Representability, Theorem
\ref{criteria-theorem-flat-groupoid-gives-algebraic-stack} (strictly speaking
we don't need this here, but it can't be stressed enough that this is true).
The morphism $U \to \mathcal{X}$ is surjective, flat, and locally
of finite presentation by
Criteria for Representability, Lemma
\ref{criteria-lemma-flat-quotient-flat-presentation}.
Thus we can check whether $U \to \mathcal{X}$ is finite by
checking whether the projection $U \times_\mathcal{X} U \to U$
has this property, see Properties of Stacks, Lemma
\ref{stacks-properties-lemma-check-property-covering}.
Since $U \times_\mathcal{X} U = R$ by
Groupoids in Spaces, Lemma
\ref{spaces-groupoids-lemma-quotient-stack-2-cartesian}
we see that this is true. Thus $\mathcal{X}$ is well-nigh affine.

\medskip\noindent
Proof of the final statement. We see that $\mathcal{X}$
is quasi-compact by Properties of Stacks, Lemma
\ref{stacks-properties-lemma-quasi-compact-stack}.
We see that $\mathcal{X} = [U/R]$ is quasi-DM and separated by
Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-properties-diagonal-from-presentation}.
\end{proof}

\begin{lemma}
\label{lemma-affine-over-well-nigh-affine}
Let the algebraic stack $\mathcal{X}$ be well-nigh affine.
\begin{enumerate}
\item If $\mathcal{X}$ is an algebraic space, then it is affine.
\item If $\mathcal{X}' \to \mathcal{X}$ is an affine morphism
of algebraic stacks, then $\mathcal{X}'$ is well-nigh affine.
\end{enumerate}
\end{lemma}

\begin{proof}
Part (1) follows from immediately from
Limits of Spaces, Lemma \ref{spaces-limits-lemma-affine}.
However, this is overkill, since (1) also follows from
Lemma \ref{lemma-well-nigh-affine} combined with
Groupoids, Proposition
\ref{groupoids-proposition-finite-flat-equivalence}.

\medskip\noindent
To prove (2) we choose an affine scheme $U$ and a
surjective, flat, finite, and finitely presented morphism $U \to \mathcal{X}$.
Then $U' = \mathcal{X}' \times_\mathcal{X} U$ admits an affine
morphism to $U$ (Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-base-change-affine}).
Therefore $U'$ is an affine scheme. Of course
$U' \to \mathcal{X}'$ is surjective, flat, finite, and finitely presented
as a base change of $U \to \mathcal{X}$.
\end{proof}

\begin{lemma}
\label{lemma-well-nigh-affine-moduli-space}
Let the algebraic stack $\mathcal{X}$ be well-nigh affine. There exists
a uniform categorical moduli space
$$
f : \mathcal{X} \longrightarrow M
$$
in the category of affine schemes. Moreover
$f$ is separated, quasi-compact, and a universal homeomorphism.
\end{lemma}

\begin{proof}
Write $\mathcal{X} = [U/R]$ with $(U, R, s, t, c)$ as in
Lemma \ref{lemma-well-nigh-affine}. Let $C$ be the ring of
$R$-invariant functions on $U$, see
Groupoids, Section \ref{groupoids-section-finite-flat}.
We set $M = \Spec(C)$. The $R$-invariant morphism
$U \to M$ corresponds to a morphism $f : \mathcal{X} \to M$ by
Lemma \ref{lemma-quotient-compare}.
The characterization of morphisms into affine schemes given in
Schemes, Lemma \ref{schemes-lemma-morphism-into-affine}
immediately guarantees that $\phi : U \to M$ is a categorical
quotient in the category of affine schemes. Hence $f$ is a
categorical moduli space in the category of affine schemes
(Lemma \ref{lemma-categorical-quotient-compare}).

\medskip\noindent
Since $\mathcal{X}$ is separated by Lemma \ref{lemma-well-nigh-affine}
we find that $f$ is separated by Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-compose-after-separated}.

\medskip\noindent
Since $U \to \mathcal{X}$ is surjective and since $U \to M$ is quasi-compact,
we see that $f$ is quasi-compact by Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-surjection-from-quasi-compact}.

\medskip\noindent
By Groupoids, Lemma \ref{groupoids-lemma-integral-over-invariants}
the composition
$$
U \to \mathcal{X} \to M
$$
is an integral morphism of affine schemes. In particular, it is
universally closed
(Morphisms, Lemma \ref{morphisms-lemma-integral-universally-closed}).
Since $U \to \mathcal{X}$ is surjective, it follows that $\mathcal{X} \to M$
is universally closed (Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-image-proper-is-proper}).
To conclude that $\mathcal{X} \to M$ is a universal homeomorphism,
it is enough to show that it is universally bijective, i.e.,
surjective and universally injective.

\medskip\noindent
We have $|\mathcal{X}| = |U|/|R|$ by
Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-points-presentation}.
Thus $|f|$ is surjective and even bijective
by Groupoids, Lemma \ref{groupoids-lemma-points}.

\medskip\noindent
Let $C \to C'$ be a ring map. Let $(U', R', s', t', c')$ be
the base change of $(U, R, s, t, c)$ by $M' = \Spec(C') \to M$.
Setting $\mathcal{X}' = [U'/R']$, we observe that
$M' \times_M \mathcal{X} = \mathcal{X}'$ by
Quotients of Groupoids, Lemma
\ref{groupoids-quotients-lemma-base-change-quotient-stack}.
Let $C^1$ be the ring of $R'$-invariant functions on $U'$.
Set $M^1 = \Spec(C^1)$ and consider the diagram
$$
\xymatrix{
\mathcal{X}' \ar[d]^{f'} \ar[r] & \mathcal{X} \ar[dd]^f \\
M^1 \ar[d] \\
M' \ar[r] & M
}
$$
By Groupoids, Lemma \ref{groupoids-lemma-invariants-base-change} and
Algebra, Lemma \ref{algebra-lemma-universally-bijective}
the morphism $M^1 \to M'$ is a homeomorphism.
On the other hand, the previous paragraph applied to
$(U', R', s', t', c')$ shows that $|f'|$ is bijective.
We conclude that $f$ induces a bijection on points after any
base change by an affine scheme. Thus $f$ is universally injective
by Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-universally-injective-local}.

\medskip\noindent
Finally, we still have to show that $f$ is a uniform moduli space
in the category of affine schemes. This follows from the discussion
above and the fact that if the
ring map $C \to C'$ is flat, then $C' \to C^1$ is an isomorphism
by Groupoids, Lemma \ref{groupoids-lemma-invariants-base-change}.
\end{proof}

\begin{lemma}
\label{lemma-well-nigh-affine-moduli-space-etale}
Let $h : \mathcal{X}' \to \mathcal{X}$ be a morphism of algebraic stacks.
Assume $\mathcal{X}'$ and $\mathcal{X}$ are well-nigh affine,
$h$ is \'etale, and $h$ induces isomorphisms on automorphism groups
(Morphisms of Stacks, Remark
\ref{stacks-morphisms-remark-identify-automorphism-groups}).
Then there exists a cartesian diagram
$$
\xymatrix{
\mathcal{X}' \ar[d] \ar[r] & \mathcal{X} \ar[d] \\
M' \ar[r] & M
}
$$
where $M' \to M$ is \'etale and
the vertical arrows are the moduli spaces constructed in
Lemma \ref{lemma-well-nigh-affine-moduli-space}.
\end{lemma}

\begin{proof}
Observe that $h$ is representable by algebraic spaces by
Morphisms of Stacks, Lemmas
\ref{stacks-morphisms-lemma-aut-iso-unramified} and
\ref{stacks-morphisms-lemma-stabilizer-preserving}.
Choose an affine scheme $U$ and a
surjective, flat, finite, and finitely presented morphism $U \to \mathcal{X}$.
Then $U' = \mathcal{X}' \times_\mathcal{X} U$ is an algebraic
space with a finite (in particular affine) morphism $U' \to \mathcal{X}'$.
By Lemma \ref{lemma-affine-over-well-nigh-affine}
we conclude that $U'$ is affine.
Setting $R = U \times_\mathcal{X} U$ and $R' = U' \times_{\mathcal{X}'} U'$
we obtain groupoids $(U, R, s, t, c)$ and $(U', R', s', t', c')$
such that $\mathcal{X} = [U/R]$ and $\mathcal{X}' = [U'/R']$,
see proof of Lemma \ref{lemma-well-nigh-affine}.
we see that the diagrams
$$
\xymatrix{
R' \ar[d]_{s'} \ar[r]_f & R \ar[d]^s \\
U' \ar[r]^f & U
}
\quad
\quad
\xymatrix{
R' \ar[d]_{t'} \ar[r]_f & R \ar[d]^t \\
U' \ar[r]^f & U
}
\quad
\quad
\xymatrix{
G' \ar[d] \ar[r]_f & G \ar[d] \\
U' \ar[r]^f & U
}
$$
are cartesian where $G$ and $G'$ are the stabilizer group schemes.
This follows for the first two by transitivity of fibre products
and for the last one this follows because it is the pullback of the
isomorphism $\mathcal{I}_{\mathcal{X}'} \to
\mathcal{X}' \times_\mathcal{X} \mathcal{I}_\mathcal{X}$
(by the already used Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-aut-iso-unramified}).
Recall that $M$, resp.\ $M'$ was constructed in
Lemma \ref{lemma-well-nigh-affine-moduli-space}
as the spectrum of the ring of $R$-invariant functions on $U$,
resp.\ the ring of $R'$-invariant functions on $U'$.
Thus $M' \to M$ is \'etale and $U' = M' \times_M U$
by Groupoids, Lemma \ref{groupoids-lemma-etale}.
It follows that $R' = M' \times_M U$, in other words
the groupoid $(U', R', s', t', c')$ is the base change of
$(U, R, s, t, c)$ by $M' \to M$.
This implies that the diagram in the lemma is
cartesian by
Quotients of Groupoids, Lemma
\ref{groupoids-quotients-lemma-base-change-quotient-stack}.
\end{proof}

\begin{lemma}
\label{lemma-moduli-space-finite-affine}
Let the algebraic stack $\mathcal{X}$ be well-nigh affine. The morphism
$$
f : \mathcal{X} \longrightarrow M
$$
of Lemma \ref{lemma-well-nigh-affine-moduli-space}
is a uniform categorical moduli space.
\end{lemma}

\begin{proof}
We already know that $M$ is a uniform categorical moduli space
in the category of affine schemes. By
Lemma \ref{lemma-check-uniform-categorical-quotient-on-affines}
it suffices to show that the base change
$f' : M' \times_M \mathcal{X} \to M'$
is a categorical moduli space for any flat morphism
$M' \to M$ of affine schemes.
Observe that $\mathcal{X}' = M' \times_M \mathcal{X}$ is well-nigh affine by
Lemma \ref{lemma-affine-over-well-nigh-affine}.
This after replacing $\mathcal{X}$ by $\mathcal{X}'$
and $M$ by $M'$, we reduce to proving $f$ is a categorical
moduli space.

\medskip\noindent
Let $g : \mathcal{X} \to Y$ be a morphism where $Y$ is an algebraic space.
We have to show that $g = h \circ f$ for a unique morphism $h : M \to Y$.

\medskip\noindent
Uniqueness. Suppose we have two morphisms $h_i : M \to Y$ with
$g = h_1 \circ f = h_2 \circ f$. Let $M' \subset M$ be the equalizer
of $h_1$ and $h_2$. Then $M' \to M$ is a monomorphism and
$f : \mathcal{X} \to M$ factors through $M'$. Thus $M' \to M$
is a universal homeomorphism. We conclude $M'$ is affine
(Morphisms, Lemma \ref{morphisms-lemma-universal-homeomorphism}).
But then since $f : \mathcal{X} \to M$
is a categorical moduli space in the category of affine schemes,
we see $M' = M$.

\medskip\noindent
Existence. Below we will show that for every $p \in M$ there exists
a cartesian square
$$
\xymatrix{
\mathcal{X}' \ar[r] \ar[d] & \mathcal{X} \ar[d] \\
M' \ar[r] & M
}
$$
with $M' \to M$ an \'etale morphism of affines and $p$ in the image such that
the composition $\mathcal{X}' \to \mathcal{X} \to Y$ factors through $M'$.
This means we can construct the map $h : M \to Y$ \'etale locally on $M$.
Since $Y$ is a sheaf for the \'etale topology and by the uniqueness shown
above, this is enough (small detail omitted).

\medskip\noindent
Let $y \in |Y|$ be the image of $p$.
Let $(V, v) \to (Y, y)$ be an \'etale morphism with $V$ affine.
Consider $\mathcal{X}' = V \times_Y \mathcal{X}$.
Observe that $\mathcal{X}' \to \mathcal{X}$ is separated and \'etale
as the base change of $V \to Y$. Moreover, $\mathcal{X}' \to \mathcal{X}$
induces isomorphisms on automorphism groups
(Morphisms of Stacks, Remark
\ref{stacks-morphisms-remark-identify-automorphism-groups})
as this is true for
$V \to Y$, see Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-base-change-stabilizer-preserving}.
Choose a presentation $\mathcal{X} = [U/R]$
as in Lemma \ref{lemma-well-nigh-affine}.
Set $U' = \mathcal{X}' \times_\mathcal{X} U = V \times_Y U$
and choose $u' \in U'$ mapping to $p$ and $v$ (possible
by Properties of Spaces, Lemma \ref{spaces-properties-lemma-points-cartesian}).
Since $U' \to U$ is separated and \'etale we see that
every finite set of points of $U'$ is contained in an affine open, see
More on Morphisms, Lemma
\ref{more-morphisms-lemma-separated-locally-quasi-finite-over-affine}.
On the other hand, the morphism $U' \to \mathcal{X}'$ is
surjective, finite, flat, and locally of finite presentation.
Setting $R' = U' \times_{\mathcal{X}'} U'$ we see
that $s', t' : R' \to U'$ are finite locally free.
By Groupoids, Lemma \ref{groupoids-lemma-find-invariant-affine}
there exists an $R'$-invariant affine open subscheme $U'' \subset U'$
containing $u'$.
Let $\mathcal{X}'' \subset \mathcal{X}'$ be
the corresponding open substack. Then $\mathcal{X}''$ is
well-nigh affine. By Lemma \ref{lemma-well-nigh-affine-moduli-space-etale}
we obtain a cartesian square
$$
\xymatrix{
\mathcal{X}'' \ar[r] \ar[d] & \mathcal{X} \ar[d] \\
M'' \ar[r] & M
}
$$
with $M'' \to M$ \'etale. Since $\mathcal{X}'' \to M''$ is
a categorical moduli space in the category of affine schemes
we obtain a morphism $M'' \to V$ such that the composition
$\mathcal{X}'' \to \mathcal{X}' \to V$ is equal to the composition
$\mathcal{X}'' \to M'' \to V$. This proves our claim and finishes
the proof.
\end{proof}

\begin{lemma}
\label{lemma-etale-separated-over-well-nigh-affine}
Let $h : \mathcal{X}' \to \mathcal{X}$ be a morphism of algebraic stacks.
Assume $\mathcal{X}$ is well-nigh affine, $h$ is \'etale, $h$ is separated,
and $h$ induces isomorphisms on automorphism groups
(Morphisms of Stacks, Remark
\ref{stacks-morphisms-remark-identify-automorphism-groups}).
Then there exists a cartesian diagram
$$
\xymatrix{
\mathcal{X}' \ar[d] \ar[r] & \mathcal{X} \ar[d] \\
M' \ar[r] & M
}
$$
where $M' \to M$ is a separated \'etale morphism of schemes and
$\mathcal{X} \to M$ is the moduli space constructed in
Lemma \ref{lemma-well-nigh-affine-moduli-space}.
\end{lemma}

\begin{proof}
Choose an affine scheme $U$ and a surjective, flat, finite, and
locally finitely presented morphism $U \to \mathcal{X}$.
Since $h$ is representable by algebraic spaces
(Morphisms of Stacks, Lemmas
\ref{stacks-morphisms-lemma-aut-iso-unramified} and
\ref{stacks-morphisms-lemma-stabilizer-preserving})
we see that $U' = \mathcal{X}' \times_\mathcal{X} U$ is
an algebraic space. Since $U' \to U$ is separated and \'etale,
we see that $U'$ is a scheme and that every finite set of points
of $U'$ is contained in an affine open, see
Morphisms of Spaces, Lemma
\ref{spaces-morphisms-lemma-locally-quasi-finite-separated-representable}
and
More on Morphisms, Lemma
\ref{more-morphisms-lemma-separated-locally-quasi-finite-over-affine}.
Setting $R' = U' \times_{\mathcal{X}'} U'$ we see
that $s', t' : R' \to U'$ are finite locally free.
By Groupoids, Lemma \ref{groupoids-lemma-find-invariant-affine}
there exists an open covering $U' = \bigcup U'_i$ by
$R'$-invariant affine open subschemes $U'_i \subset U'$.
Let $\mathcal{X}'_i \subset \mathcal{X}'$ be the corresponding
open substacks. These are well-nigh affine as $U'_i \to \mathcal{X}'_i$
is surjective, flat, finite and of finite presentation. By
Lemma \ref{lemma-well-nigh-affine-moduli-space-etale}
we obtain cartesian diagrams
$$
\xymatrix{
\mathcal{X}'_i \ar[r] \ar[d] & \mathcal{X} \ar[d] \\
M'_i \ar[r] & M
}
$$
with $M'_i \to M$ an \'etale morphism of affine schemes
and vertical arrows as in
Lemma \ref{lemma-well-nigh-affine-moduli-space}.
Observe that
$\mathcal{X}'_{ij} = \mathcal{X}'_i \cap \mathcal{X}'_j$
is an open subspace of $\mathcal{X}'_i$ and $\mathcal{X}'_j$.
Hence we get corresponding open subschemes
$V_{ij} \subset M'_i$ and $V_{ji} \subset M'_j$.
By the result of
Lemma \ref{lemma-moduli-space-finite-affine}
we see that both
$\mathcal{X}'_{ij} \to V_{ij}$ and
$\mathcal{X}'_{ji} \to V_{ji}$ are categorical moduli spaces!
Thus we get a unique isomorphism $\varphi_{ij} : V_{ij} \to V_{ji}$
such that
$$
\xymatrix{
\mathcal{X}'_i \ar[d] & &
\mathcal{X}'_i \cap \mathcal{X}'_j \ar[rr] \ar[ll] \ar[ld] \ar[rd] & &
\mathcal{X}'_j \ar[d] \\
M'_i &
V_{ij} \ar[l] \ar[rr]^{\varphi_{ij}} & &
V_{ji} \ar[r] &
M'_j
}
$$
is commutative. These isomorphisms satisfy the cocyclce condition of
Schemes, Section \ref{schemes-section-glueing-schemes} by a computation
(and another application of the previous lemma) which we omit.
Thus we can glue the affine schemes in to scheme $M'$, see
Schemes, Lemma \ref{schemes-lemma-glue}.
Let us identify the $M'_i$ with their image in $M'$.
We claim there is a morphism $\mathcal{X}' \to M'$ fitting into
cartesian diagrams
$$
\xymatrix{
\mathcal{X}'_i \ar[r] \ar[d] & \mathcal{X}' \ar[d] \\
M'_i \ar[r] & M'
}
$$
This is clear from the description of the morphisms into the glued scheme $M'$
in Schemes, Lemma \ref{schemes-lemma-glue} and the fact that to give a morphism
$\mathcal{X}' \to M'$ is the same thing as given a morphism $T \to M'$
for any morphism $T \to \mathcal{X}'$.
Similarly, there is a morphism $M' \to M$ restricting to the
given morphisms $M'_i \to M$ on $M'_i$.
The morphism $M' \to M$ is \'etale (being \'etale on the members of an
\'etale covering) and the fibre product property holds as it can
be checked on members of the (affine) open covering $M' = \bigcup M'_i$.
Finally, $M' \to M$ is separated because the composition
$U' \to \mathcal{X}' \to M'$ is surjective and universally closed
and we can apply Morphisms, Lemma
\ref{morphisms-lemma-image-universally-closed-separated}.
\end{proof}

\begin{lemma}
\label{lemma-etale-local-finite-inertia}
Let $\mathcal{X}$ be an algebraic stack. Assume
$\mathcal{I}_\mathcal{X} \to \mathcal{X}$ is finite.
Then there exist a set $I$ and for $i \in I$ a morphism of algebraic stacks
$$
g_i : \mathcal{X}_i \longrightarrow \mathcal{X}
$$
with the following properties
\begin{enumerate}
\item $|\mathcal{X}| = \bigcup |g_i|(|\mathcal{X}_i|)$,
\item $\mathcal{X}_i$ is well-nigh affine,
\item $\mathcal{I}_{\mathcal{X}_i} \to
\mathcal{X}_i \times_\mathcal{X} \mathcal{I}_\mathcal{X}$
is an isomorphism, and
\item $g_i : \mathcal{X}_i \to \mathcal{X}$ is representable
by algebraic spaces, separated, and \'etale,
\end{enumerate}
\end{lemma}

\begin{proof}
For any $x \in |\mathcal{X}|$ we can choose
$g : \mathcal{U} \to \mathcal{X}$, $\mathcal{U} = [U/R]$, and $u$ as in
Morphisms of Stacks,
Lemma \ref{stacks-morphisms-lemma-etale-local-quasi-DM-at-x}.
Then by
Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-stabilizer-preserving-unramified}
we see that there exists an open substack
$\mathcal{U}' \subset \mathcal{U}$ containing $u$
such that $\mathcal{I}_{\mathcal{U}'} \to
\mathcal{U}' \times_\mathcal{X} \mathcal{I}_\mathcal{X}$
is an isomorphism.
Let $U' \subset U$ be the $R$-invariant open corresponding to
the open substack $\mathcal{U}'$.
Let $u' \in U'$ be a point of $U'$ mapping to $u$.
Observe that $t(s^{-1}(\{u'\}))$ is finite as $s : R \to U$ is finite.
By Properties, Lemma \ref{properties-lemma-ample-finite-set-in-affine}
and Groupoids, Lemma \ref{groupoids-lemma-find-invariant-affine}
we can find an $R$-invariant affine open $U'' \subset U'$
containing $u'$. Let $R''$ be the restriction of $R$ to $U''$.
Then $\mathcal{U}'' = [U''/R'']$ is an open substack of
$\mathcal{U}'$ containing $u$, is well-nigh affine,
$\mathcal{I}_{\mathcal{U}''} \to
\mathcal{U}'' \times_\mathcal{X} \mathcal{I}_\mathcal{X}$
is an isomorphism, and $\mathcal{U}'' \to \mathcal{X}$
and is representable by algebraic spaces and \'etale.
Finally, $\mathcal{U}'' \to \mathcal{X}$ is separated as
$\mathcal{U}''$ is separated (Lemma \ref{lemma-well-nigh-affine})
the diagonal of $\mathcal{X}$ is separated
(Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-diagonal-diagonal})
and separatedness follows from Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-compose-after-separated}.
Since the point $x \in |\mathcal{X}|$ is arbitrary the proof is complete.
\end{proof}

\begin{theorem}[Keel-Mori]
\label{theorem-keel-mori}
Let $\mathcal{X}$ be an algebraic stack. Assume
$\mathcal{I}_\mathcal{X} \to \mathcal{X}$ is finite.
Then there exists a uniform categorical moduli space
$$
f : \mathcal{X} \longrightarrow M
$$
and $f$ is separated, quasi-compact, and a universal homeomorphism.
\end{theorem}

\begin{proof}
We choose a set $I$\footnote{The reader who is still keeping
track of set theoretic issues should make sure $I$ is not too large.}
and for $i \in I$ a morphism of algebraic stacks
$g_i : \mathcal{X}_i \to \mathcal{X}$ as in
Lemma \ref{lemma-etale-local-finite-inertia}; we will use all
of the properties listed in this lemma without further mention.
Let
$$
f_i : \mathcal{X}_i \to M_i
$$
be as in Lemma \ref{lemma-well-nigh-affine-moduli-space}.
Consider the stacks
$$
\mathcal{X}_{ij} = \mathcal{X}_i \times_{g_i, \mathcal{X}, g_j} \mathcal{X}_j
$$
for $i, j \in I$. The projections $\mathcal{X}_{ij} \to \mathcal{X}_i$
and $\mathcal{X}_{ij} \to \mathcal{X}_j$ are separated
by Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-base-change-separated},
\'etale by Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-base-change-etale},
and induce isomorphisms on automorphism groups
(as in Morphisms of Stacks, Remark
\ref{stacks-morphisms-remark-identify-automorphism-groups}) by
Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-base-change-stabilizer-preserving}.
Thus we may apply Lemma \ref{lemma-etale-separated-over-well-nigh-affine}
to find a commutative diagram
$$
\xymatrix{
\mathcal{X}_i \ar[d]_{f_i} &
\mathcal{X}_{ij} \ar[d]_{f_{ij}} \ar[l] \ar[r] &
\mathcal{X}_j \ar[d]_{f_j} \\
M_i &
M_{ij} \ar[l] \ar[r] &
M_j
}
$$
with cartesian squares where $M_{ij} \to M_i$ and $M_{ij} \to M_j$
are separated \'etale morphisms of schemes; here we also use that $f_i$
is a uniform categorical quotient by
Lemma \ref{lemma-moduli-space-finite-affine}.
Claim:
$$
\coprod M_{ij} \longrightarrow \coprod M_i \times \coprod M_i
$$
is an \'etale equivalence relation.

\medskip\noindent
Proof of the claim. Set $R = \coprod M_{ij}$ and $U = \coprod M_i$.
We have already seen that $t : R \to U$ and $s : R \to U$ are \'etale.
Let us construct a morphism $c : R \times_{s, U, t} R \to R$
compatible with $\text{pr}_{13} : U \times U \times U \to U \times U$.
Namely, for $i, j, k \in I$ we consider
$$
\mathcal{X}_{ijk} =
\mathcal{X}_i \times_{g_i, \mathcal{X}, g_j} \mathcal{X}_j
\times_{g_j, \mathcal{X}, g_k} \mathcal{X}_k =
\mathcal{X}_{ij} \times_{\mathcal{X}_j} \mathcal{X}_{jk}
$$
Arguing exactly as in the previous paragraph,
we find that $M_{ijk} = M_{ij} \times_{M_j} M_{jk}$
is a categorical moduli space for $\mathcal{X}_{ijk}$.
In particular, there is a canonical morphism
$M_{ijk} = M_{ij} \times_{M_j} M_{jk} \to M_{ik}$
coming from the projection $\mathcal{X}_{ijk} \to \mathcal{X}_{ik}$.
Putting these morphisms together we obtain the morphism $c$.
In a similar fashion we construct a morphism $e : U \to R$
compatible with $\Delta : U \to U \times U$ and
$i : R \to R$ compatible with the flip $U \times U \to U \times U$.
Let $k$ be an algebraically closed field. Then
$$
\Mor(\Spec(k), \mathcal{X}_i) \to \Mor(\Spec(k), M_i) = M_i(k)
$$
is bijective on isomorphism classes and the same remains true after any
base change by a morphism $M' \to M$. This follows from our choice
of $f_i$ and Morphisms of Stacks, Lemmas
\ref{stacks-morphisms-lemma-universally-injective} and
\ref{stacks-morphisms-lemma-universally-injective-point}.
By construction of $2$-fibred products the diagram
$$
\xymatrix{
\Mor(\Spec(k), \mathcal{X}_{ij}) \ar[d] \ar[r] &
\Mor(\Spec(k), \mathcal{X}_j) \ar[d] \\
\Mor(\Spec(k), \mathcal{X}_i) \ar[r] &
\Mor(\Spec(k), \mathcal{X})
}
$$
is a fibre product of categories. By our choice of $g_i$ the
functors in this diagram induce bijections on automorphism groups.
It follows that this diagram induces a fibre product diagram
on sets of isomorphism classes! Thus we see that
$$
R(k) = U(k) \times_{|\Mor(\Spec(k), \mathcal{X})|} U(k)
$$
where $|\Mor(\Spec(k), \mathcal{X})|$ denotes the set
of isomorphism classes.
In particular, for any algebraically closed field $k$
the map on $k$-valued point is an equivalence relation.
We conclude the claim holds by
Groupoids, Lemma \ref{groupoids-lemma-etale-equivalence-relation}.

\medskip\noindent
Let $M = U/R$ be the algebraic space which is the quotient of the above
\'etale equivalence relation, see
Spaces, Theorem \ref{spaces-theorem-presentation}.
There is a canonical morphism $f : \mathcal{X} \to M$
fitting into commutative diagrams
\begin{equation}
\label{equation-fundamental-diagram}
\xymatrix{
\mathcal{X}_i \ar[r]_{g_i} \ar[d]_{f_i} & \mathcal{X} \ar[d]^f \\
M_i \ar[r] & M
}
\end{equation}
Namely, such a morphism $f$ is given by a functor
$$
f : \Mor(T, \mathcal{X}) \longrightarrow \Mor(T, M)
$$
for any scheme $T$ compatible with base change. Let $a : T \to \mathcal{X}$
be an object of the left hand side. We obtain an \'etale covering
$\{T_i \to T\}$ with $T_i = \mathcal{X}_i \times_\mathcal{X} T$
and morphisms $a_i : T_i \to \mathcal{X}_i$. Then we get
$b_i = f_i \circ a_i : T_i \to M_i$. Since
$T_i \times_T T_j = \mathcal{X}_{ij} \times_\mathcal{X} T$
we moreover get a morphism $a_{ij} : T_i \times_T T_j \to \mathcal{X}_{ij}$.
Setting $b_{ij} = f_{ij} \circ a_{ij}$ we find that
$b_i \times b_j$ factors through the monomorphism
$M_{ij} \to M_i \times M_j$. Hence the morphisms
$$
T_i \xrightarrow{b_i} M_i \to M
$$
agree on $T_i \times_T T_j$. As $M$ is a sheaf for the \'etale
topology, we see that these morphisms glue to a unique
morphism $b = f(a) : T \to M$. We omit the verification that
this construction is compatible with base change and we omit
the verification that the diagrams
(\ref{equation-fundamental-diagram}) commute.

\medskip\noindent
Claim: the diagrams (\ref{equation-fundamental-diagram}) are cartesian.
To see this we study the induced morphism
$$
h_i : \mathcal{X}_i \longrightarrow M_i \times_M \mathcal{X}
$$
This is a morphism of stacks \'etale over $\mathcal{X}$
and hence $h_i$ is \'etale (Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-etale-permanence}).
Since $g_i$ is separated, we see $h_i$ is separated
(use Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-compose-after-separated} and the fact
seen above that the diagonal of $\mathcal{X}$ is separated).
The morphism $h_i$ induces isomorphisms on automorphism groups
(Morphisms of Stacks, Remark
\ref{stacks-morphisms-remark-identify-automorphism-groups})
as this is true for $g_i$. For an algebraically closed field $k$
the diagram
$$
\xymatrix{
\Mor(\Spec(k), M_i \times_M \mathcal{X}) \ar[r] \ar[d] &
\Mor(\Spec(k), \mathcal{X}) \ar[d] \\
M_i(k) \ar[r] &
M(k)
}
$$
is a catesian diagram of categories and the top arrow
induces bijections on automorphism groups.
On the other hand, we have
$$
M(k) = U(k)/R(k) = U(k)/
U(k) \times_{|\Mor(\Spec(k), \mathcal{X})|} U(k) =
|\Mor(\Spec(k), \mathcal{X})|
$$
by what we said above. Thus the right vertical arrow in the
cartesian diagram above is a bijection on isomorphism classes.
We conclude that
$|\Mor(\Spec(k), M_i \times_M \mathcal{X})| \to M_i(k)$ is bijective.
Review: $h_i$ is a separated, \'etale, induces isomorphisms on
automorphism groups (as in Morphisms of Stacks, Remark
\ref{stacks-morphisms-remark-identify-automorphism-groups}), and
induces an equivalence on fibre categories over algebraically closed fields.
Hence it is an isomorphism by Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-etale-iso}.

\medskip\noindent
From the claim we get in particular the following:
we have a surjective \'etale morphism $U \to M$
such that the base change of $f$ is separated, quasi-compact,
and a universal homeomorphism. It follows that $f$ is separated,
quasi-compact, and a universal homeomorphism.
See Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-check-separated-covering},
\ref{stacks-morphisms-lemma-check-quasi-compact-covering}, and
\ref{stacks-morphisms-lemma-check-universal-homeomorphism-covering}

\medskip\noindent
To finish the proof we have to show that $f : \mathcal{X} \to M$
is a uniform categorical moduli space.
To prove this it suffices to show that given a flat morphism
$M' \to M$ of algebraic spaces, the base change
$$
M' \times_M \mathcal{X} \longrightarrow M'
$$
is a categorical moduli space. Thus we consider a morphism
$$
\theta : M' \times_M \mathcal{X} \longrightarrow E
$$
where $E$ is an algebraic space. For each $i$ we know that
$f_i$ is a uniform categorical moduli space. Hence we obtain
$$
\xymatrix{
M' \times_M \mathcal{X}_i \ar[d] \ar[r] &
M' \times_M \mathcal{X} \ar[d]^\theta \\
M' \times_M M_i \ar[r]^{\psi_i} &
E
}
$$
Since $\{M' \times_M M_i \to M'\}$ is an \'etale covering,
to obtain the desired morphism $\psi : M' \to E$ it suffices
to show that $\psi_i$ and $\psi_j$ agree over
$M' \times_M M_i \times_M M_j = M' \times_M M_{ij}$.
This follows easily from the fact that
$f_{ij} : \mathcal{X}_{ij} =
\mathcal{X}_i \times_\mathcal{X} \mathcal{X}_j \to M_{ij}$ is a uniform
categorical quotient; details omitted.
Then finally one shows that $\psi$ fits into the commutative diagram
$$
\xymatrix{
M' \times_M \mathcal{X} \ar[d] \ar[rd]^\theta \\
M' \ar[r]^\psi &
E
}
$$
because ``$\{M' \times_M \mathcal{X}_i \to M' \times_M \mathcal{X}\}$
is an \'etale covering'' and the morphisms $\psi_i$ fit into the
corresponding commutative diagrams by construction.
This finishes the proof of the Keel-Mori theorem.
\end{proof}

\noindent
The following lemma emphasizes the \'etale local nature of the construction.

\begin{lemma}
\label{lemma-etale-separated-over-keel-mori}
Let $h : \mathcal{X}' \to \mathcal{X}$ be a morphism of algebraic stacks.
Assume
\begin{enumerate}
\item $\mathcal{I}_\mathcal{X} \to \mathcal{X}$ is finite,
\item $h$ is \'etale, separated, and induces isomorphisms on
automorphism groups (Morphisms of Stacks, Remark
\ref{stacks-morphisms-remark-identify-automorphism-groups}).
\end{enumerate}
Then there exists a cartesian diagram
$$
\xymatrix{
\mathcal{X}' \ar[d] \ar[r] &
\mathcal{X} \ar[d] \\
M' \ar[r] &
M
}
$$
where $M' \to M$ is a separated \'etale morphism of algebraic spaces and
the vertical arrows are the moduli spaces constructed in
Theorem \ref{theorem-keel-mori}.
\end{lemma}

\begin{proof}
By Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-aut-iso-unramified}
we see that
$\mathcal{I}_{\mathcal{X}'} \to
\mathcal{X}' \times_\mathcal{X} \mathcal{I}_\mathcal{X}$
is an isomorphism. Hence $\mathcal{I}_{\mathcal{X}'} \to \mathcal{X}'$
is finite as a base change of $\mathcal{I}_\mathcal{X} \to \mathcal{X}$.
Let $f' : \mathcal{X}' \to M'$ and $f : \mathcal{X} \to M$ be as in
Theorem \ref{theorem-keel-mori}.
We obtain a commutative diagram as in the lemma because
$f'$ is categorical moduli space.
Choose $I$ and $g'_i : \mathcal{X}'_i \to \mathcal{X}'$ as in
Lemma \ref{lemma-etale-local-finite-inertia}.
Observe that $g_i = h \circ g'_i$
is \'etale, separated, and induces isomorphisms on
automorphism groups (Morphisms of Stacks, Remark
\ref{stacks-morphisms-remark-identify-automorphism-groups}).
Let $f'_i : \mathcal{X}'_i \to M'_i$ be as in
Lemma \ref{lemma-well-nigh-affine-moduli-space}.
In the proof of Theorem \ref{theorem-keel-mori}
we have seen that the diagrams
$$
\xymatrix{
\mathcal{X}'_i \ar[d]_{f'_i} \ar[r]_{g'_i} &
\mathcal{X}' \ar[d]^{f'} \\
M'_i \ar[r] &
M'
}
\quad\text{and}\quad
\xymatrix{
\mathcal{X}'_i \ar[d]_{f'_i} \ar[r]_{g_i} &
\mathcal{X} \ar[d]^f \\
M'_i \ar[r] &
M
}
$$
are cartesian and that $M'_i \to M'$ and $M'_i \to M$ are \'etale
(this also follows directly from the properties of the morphisms
$g'_i, g_i, f', f'_i, f$ listed sofar by arguing in exactly the same way).
This first implies that $M' \to M$ is \'etale and second that
the diagram in the lemma is cartesian. We still need to show
that $M' \to M$ is separated. To do this we contemplate the
diagram
$$
\xymatrix{
\mathcal{X}' \ar[r] \ar[d] &
\mathcal{X}' \times_\mathcal{X} \mathcal{X}' \ar[d] \\
M' \ar[r] &
M' \times_M M'
}
$$
The top horizontal arrow is universally closed as
$\mathcal{X}' \to \mathcal{X}$ is separated.
The vertical arrows are as in Theorem \ref{theorem-keel-mori}
(as flat base changes of $\mathcal{X} \to M$)
hence universal homeomorphisms. Thus the lower horizontal
arrow is universally closed. This (combined with it being an \'etale
monomorphism of algebraic spaces) proves it is a closed immersion as desired.
\end{proof}





\section{Properties of moduli spaces}
\label{section-properties-moduli-spaces}

\noindent
Once the existence of a moduli space has been proven,
it becomes possible (and is usually straightforward) to
establish properties of these moduli spaces.

\begin{lemma}
\label{lemma-keel-mori-finite-type}
Let $p : \mathcal{X} \to Y$ be a morphism of an algebraic stack to an
algebraic space. Assume
\begin{enumerate}
\item $\mathcal{I}_\mathcal{X} \to \mathcal{X}$ is finite,
\item $Y$ is locally Noetherian, and
\item $p$ is locally of finite type.
\end{enumerate}
Let $f : \mathcal{X} \to M$ be the moduli space constructed in
Theorem \ref{theorem-keel-mori}.
Then $M \to Y$ is locally of finite type.
\end{lemma}

\begin{proof}
Since $f$ is a uniform categorical moduli space we obtain the
morphism $M \to Y$. It suffices to check that $M \to Y$
is locally of finite type \'etale locally on $M$ and $Y$.
Since $f$ is a uniform categorical moduli space, we
may first replace $Y$ by an affine scheme \'etale over $Y$.
Next, we may choose $I$ and $g_i : \mathcal{X}_i \to \mathcal{X}$
as in Lemma \ref{lemma-etale-local-finite-inertia}.
Then by Lemma \ref{lemma-etale-separated-over-keel-mori}
we reduce to the case $\mathcal{X} = \mathcal{X}_i$.
In other words, we may assume $\mathcal{X}$ is well-nigh affine.
In this case we have $Y = \Spec(A_0)$, we have
$\mathcal{X} = [U/R]$ with $U = \Spec(A)$ and
$M = \Spec(C)$ where $C \subset A$ is the set of $R$-invariant
functions on $U$. See
Lemmas \ref{lemma-well-nigh-affine} and
\ref{lemma-well-nigh-affine-moduli-space}.
Then $A_0$ is Noetherian and $A_0 \to A$ is of finite type.
Moreover $A$ is integral over $C$ by
Groupoids, Lemma \ref{groupoids-lemma-integral-over-invariants},
hence finite over $C$
(being of finite type over $A_0$).
Thus we may finally apply
Algebra, Lemma \ref{algebra-lemma-Artin-Tate}
to conclude.
\end{proof}

\begin{lemma}
\label{lemma-keel-mori-diagonal}
Let $\mathcal{X}$ be an algebraic stack. Assume
$\mathcal{I}_\mathcal{X} \to \mathcal{X}$ is finite.
Let $f : \mathcal{X} \to M$ be the moduli space constructed in
Theorem \ref{theorem-keel-mori}.
\begin{enumerate}
\item If $\mathcal{X}$ is quasi-separated, then $M$ is quasi-separated.
\item If $\mathcal{X}$ is separated, then $M$ is separated.
\item Add more here, for example relative versions of the above.
\end{enumerate}
\end{lemma}

\begin{proof}
To prove this consider the following diagram
$$
\xymatrix{
\mathcal{X} \ar[d]_f \ar[r]_{\Delta_\mathcal{X}} &
\mathcal{X} \times \mathcal{X} \ar[d]^{f \times f} \\
M \ar[r]^{\Delta_M} &
M \times M
}
$$
Since $f$ is a universal homeomorphism, we see that
$f \times f$ is a universal homeomorphism.

\medskip\noindent
If $\mathcal{X}$ is separated, then $\Delta_\mathcal{X}$ is proper,
hence $\Delta_\mathcal{X}$ is universally closed, hence
$\Delta_M$ is universally closed, hence $M$ is separated
by Morphisms of Spaces, Lemma
\ref{spaces-morphisms-lemma-separated-diagonal-proper}.

\medskip\noindent
If $\mathcal{X}$ is quasi-separated, then $\Delta_\mathcal{X}$ is
quasi-compact, hence $\Delta_M$ is quasi-compact, hence $M$ is
quasi-separated.
\end{proof}

\begin{lemma}
\label{lemma-keel-mori-proper}
Let $p : \mathcal{X} \to Y$ be a morphism from an algebraic stack
to an algebraic space. Assume
\begin{enumerate}
\item $\mathcal{I}_\mathcal{X} \to \mathcal{X}$ is finite,
\item $p$ is proper, and
\item $Y$ is locally Noetherian.
\end{enumerate}
Let $f : \mathcal{X} \to M$ be the moduli space constructed in
Theorem \ref{theorem-keel-mori}. Then $M \to Y$ is proper.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-keel-mori-finite-type}
we see that $M \to Y$ is locally of finite type.
By Lemma \ref{lemma-keel-mori-diagonal} we see that
$M \to Y$ is separated.
Of course $M \to Y$ is quasi-compact and universally closed
as these are topological properties and $\mathcal{X} \to Y$
has these properties and $\mathcal{X} \to M$ is a universal
homeomorphism.
\end{proof}





\section{Stacks and fpqc coverings}
\label{section-fpqc}

\noindent
Certain algebraic stacks satisfy fpqc descent.
The analogue of this section for algebraic spaces
is Properties of Spaces, Section \ref{spaces-properties-section-fpqc}.


\begin{proposition}
\label{proposition-stack-fpqc}
\begin{reference}
Proposition 3.3.6 of ``Intro to Algebraic Stacks'' by
Anatoly Preygel.
\end{reference}
Let $\mathcal{X}$ be an algebraic stack with quasi-affine\footnote{It suffices
to assume ind-quasi-affine.} diagonal. Then
$\mathcal{X}$ satisfies descent for fpqc coverings.
\end{proposition}

\begin{proof}
Our conventions are that $\mathcal{X}$ is a stack
in groupoids $p : \mathcal{X} \to (\Sch/S)_{fppf}$
over the category of schemes over a base scheme $S$ endowed
with the fppf topology. The statement means the following:
given an fpqc covering $\mathcal{U} = \{U_i \to U\}_{i \in I}$
of schemes over $S$ the functor
$$
\mathcal{X}_U \longrightarrow DD(\mathcal{U})
$$
is an equivalence. Here on the left we have the category
of objects of $\mathcal{X}$ over $U$ and on the right we have
the category of descent data in $\mathcal{X}$ relative to $\mathcal{U}$.
See discussion in Stacks, Section \ref{stacks-section-descent-data}.

\medskip\noindent
Fully faithfulness. Suppose we have two objects $x, y$ of $\mathcal{X}$
over $U$. Then $I = \mathit{Isom}(x, y)$ is an algebraic space over $U$.
Hence a collection of sections of $I$ over $U_i$ whose restrictions
to $U_i \times_U U_j$ agree, come from a unique section over $U$ by
the analogue of the proposition for algebraic spaces, see
Properties of Spaces, Proposition
\ref{spaces-properties-proposition-sheaf-fpqc}.
Thus our functor is fully faithful.

\medskip\noindent
Essential surjectivity. Here we are given objects
$x_i$ over $U_i$ and isomorphisms
$\varphi_{ij} : \text{pr}_0^*x_i \to \text{pr}_1^*x_j$
over $U_i \times_U U_j$ satisfying the cocyle condition
over $U_i \times_U U_j \times_U U_k$.

\medskip\noindent
Let $W$ be an affine scheme and let $W \to \mathcal{X}$
be a morphism. For each $i$ we can form
$$
W_i = U_i \times_{x_i, \mathcal{X}} W
$$
The projection $W_i \to U_i$ is quasi-affine as the
diagonal of $\mathcal{X}$ is quasi-affine. For each pair
$i, j \in I$ the isomorphism $\varphi_{ij}$ induces
an isomorphism
$$
W_i \times_U U_j =
(U_i \times_U U_j) \times_{x_i \circ \text{pr}_0, \mathcal{X}} W
\to
(U_i \times_U U_j) \times_{x_j \circ \text{pr}_1, \mathcal{X}} W =
U_i \times_U W_j
$$
Moreover, these isomorphisms satisfy the cocycle condition over
$U_i \times_U U_j \times_U U_k$. In other words, these isomorphisms
define a descent datum on the schemes $W_i/U_i$ relative to $\mathcal{U}$.
By Descent, Lemma \ref{descent-lemma-quasi-affine}
we see that this descent datum is effective\footnote{Or use
More on Groupoids, Lemma \ref{more-groupoids-lemma-ind-quasi-affine}
in the case of ind-quasi-affine diagonal.}.
We conclude that there exists a quasi-affine morphism
$W' \to U$ and a commutative diagram
$$
\xymatrix{
W' \ar[d] &
W_i \ar[l] \ar[d] \ar[r] &
W \ar[d] \\
U &
U_i \ar[l] \ar[r]^{x_i} &
\mathcal{X}
}
$$
whose squares are cartesian. Since $\{W_i \to W'\}_{i \in I}$
is the base change of $\mathcal{U}$ by $W' \to U$ we conclude
that it is an fpqc covering. Since $W$ satisfies the sheaf
condition for fpqc coverings, we obtain a unique morphism
$W' \to W$ such that $W_i \to W' \to W$ is the given morphism
$W_i \to W$. In other words, we have the commutative diagrams
$$
\xymatrix{
W_i \ar[d] \ar[r] &
W' \ar[d] \ar[r] &
W \ar[d] \\
U_i \ar[r] \ar@/_1pc/[rr]_{x_i} &
U &
\mathcal{X}
}
$$
compatible with the isomorphisms $\varphi_{ij}$ and whose
square and rectangle are cartesian.

\medskip\noindent
Choose a collection of affine schemes $W_\alpha$, $\alpha \in A$
and smooth morphisms $W_\alpha \to \mathcal{X}$ such that
$\coprod W_\alpha \to \mathcal{X}$ is surjective.
By the procedure of the preceding paragraph we produce
a diagram
$$
\xymatrix{
W_{\alpha, i} \ar[d] \ar[r] &
W_\alpha' \ar[d] \ar[r] &
W_\alpha \ar[d] \\
U_i \ar[r] \ar@/_1pc/[rr]_{x_i} &
U &
\mathcal{X}
}
$$
for each $\alpha$. Then the morphisms $W_\alpha' \to U$ are
smooth and jointly surjective.

\medskip\noindent
Denote $x_\alpha$ the object of $\mathcal{X}$ over $W_\alpha'$
corresponding to $W_\alpha' \to W_\alpha \to \mathcal{X}$.
Since $\mathcal{X}$ is an fppf stack and since
$\{W_\alpha' \to U\}$ is an fppf covering, it suffices
to show that there are isomorphisms
$\text{pr}_0^*x_\alpha \to \text{pr}_1^*x_\beta$
over $W_\alpha' \times_U W'_\beta$ satisfying the
cocycle condition. However, after pulling back to
$W_{\alpha, i}$ we do have such isomorphisms over
$W_{\alpha, i} \times_{U_i} W_{\beta, i} =
U_i \times_U (W_\alpha' \times_U W'_\beta)$
since the pullback of $x_\alpha$ to $W_{\alpha, i}$
is isomorphic to the pullback of $x_i$ to $W_{\alpha, i}$.
Since $\{U_i \times_U (W_\alpha' \times_U W'_\beta) \to
W_\alpha' \times_U W'_\beta\}_{i \in I}$
is an fpqc covering and by the aforementioned compatibility
of the diagrams above with $\varphi_{ij}$ these
isomorphisms descend to $W_\alpha' \times_U W'_\beta$
and the proof is complete.
\end{proof}










\section{Tensor functors}
\label{section-tensor-functors}

\noindent
Let $f : \mathcal{Y} \to \mathcal{X}$ be a morphism of Noetherian
algebraic stacks. The pullback functor
$$
f^* :
\textit{Coh}(\mathcal{O}_\mathcal{X})
\longrightarrow
\textit{Coh}(\mathcal{O}_\mathcal{Y})
$$
is a right exact tensor functor: it is additive, right exact,
and commutes with tensor products of coherent modules. We can
ask to what extent any right exact tensor functor
$F : \textit{Coh}(\mathcal{O}_\mathcal{X}) \to
\textit{Coh}(\mathcal{O}_\mathcal{Y})$ comes from a
morphism $f : \mathcal{Y} \to \mathcal{X}$.
The reader may consult
\cite{Hall-Rydh-coherent} for a very general result
of this nature.
The aim of this section is to give a short proof of
Theorem \ref{theorem-main} as an introduction to these ideas.

\medskip\noindent
We begin with some lemmas.

\begin{lemma}
\label{lemma-extend}
Let $\mathcal{X}$ and $\mathcal{Y}$ be Noetherian algebraic stacks.
Any right exact tensor functor $F : \textit{Coh}(\mathcal{O}_\mathcal{X}) \to
\textit{Coh}(\mathcal{O}_\mathcal{Y})$ extends uniquely to a
right exact tensor functor
$F : \QCoh(\mathcal{O}_\mathcal{X}) \to \QCoh(\mathcal{O}_\mathcal{Y})$
commuting with all colimits.
\end{lemma}

\begin{proof}
The existence and uniqueness of the extension is a general fact, see
Categories, Lemma \ref{categories-lemma-extend-functor-by-colim}.
To see that the lemma applies observe that coherent modules on
locally Noetherian algebraic stacks are by definition modules
of finite presentation, see
Cohomology of Stacks, Definition \ref{stacks-cohomology-definition-coherent}.
Hence a coherent module on $\mathcal{X}$ is a
categorically compact object of $\QCoh(\mathcal{O}_\mathcal{X})$ by
Cohomology of Stacks, Lemma
\ref{stacks-cohomology-lemma-finite-presentation-quasi-compact-colimit}.
Finally, every quasi-coherent module is a filtered colimit of
its coherent submodules by Cohomology of Stacks, Lemma
\ref{stacks-cohomology-lemma-directed-colimit-coherent}.

\medskip\noindent
Since $F$ is additive, also the extension of $F$ is additive (details omitted).
Since $F$ is a tensor functor and since colimits of modules
commute with taking tensor products, also the extension of $F$
is a tensor functor (details omitted).

\medskip\noindent
In this paragraph we show the extension commutes with arbitrary
direct sums. If $\mathcal{F} = \bigoplus_{j \in J} \mathcal{H}_j$
with $\mathcal{H}_j$ quasi-coherent, then
$\mathcal{F} = \colim_{J' \subset J\text{ finite}}
\bigoplus_{j \in J'} \mathcal{H}_j$.
Denoting the extension of $F$ also by $F$ we obtain
\begin{align*}
F(\mathcal{F})
& =
\colim_{J' \subset J\text{ finite}}
F(\bigoplus\nolimits_{j \in J'} \mathcal{H}_j) \\
& =
\colim_{J' \subset J\text{ finite}}
\bigoplus\nolimits_{j \in J'} F(\mathcal{H}_j) \\
& =
\bigoplus\nolimits_{j \in J} F(\mathcal{H}_j)
\end{align*}
Thus $F$ commutes with arbitrary direct sums.

\medskip\noindent
In this paragraph we show that the extension is right exact.
Suppose $0 \to \mathcal{F} \to \mathcal{F}' \to \mathcal{F}'' \to 0$
is a short exact sequence of quasi-coherent $\mathcal{O}_\mathcal{X}$-modules.
Then we write $\mathcal{F}' = \bigcup \mathcal{F}'_i$ as the
union of its coherent submodules (see reference given above).
Denote $\mathcal{F}''_i \subset \mathcal{F}''$ the image of $\mathcal{F}'_i$
and denote $\mathcal{F}_i = \mathcal{F} \cap \mathcal{F}'_i =
\Ker(\mathcal{F}'_i \to \mathcal{F}''_i)$. Then it is clear that
$\mathcal{F} = \bigcup \mathcal{F}_i$ and
$\mathcal{F}'' = \bigcup \mathcal{F}''_i$
and that we have short exact sequences
$$
0 \to \mathcal{F}_i \to \mathcal{F}_i' \to \mathcal{F}_i'' \to 0
$$
Since the extension commutes with filtered colimits we have
$F(\mathcal{F}) = \colim_{i \in I} F(\mathcal{F}_i)$,
$F(\mathcal{F}') = \colim_{i \in I} F(\mathcal{F}'_i)$, and
$F(\mathcal{F}'') = \colim_{i \in I} F(\mathcal{F}''_i)$.
Since filtered colimits of sheaves of modules is exact we
conclude that the extension of $F$ is right exact.

\medskip\noindent
The proof is finished as a right exact functor which commutes with all
coproducts commutes with all colimits, see
Categories, Lemma \ref{categories-lemma-colimits-coproducts-coequalizers}.
\end{proof}

\begin{lemma}
\label{lemma-affine}
Let $\mathcal{X}$ be an algebraic stack with affine diagonal.
Let $B$ be a ring. Let $F : \QCoh(\mathcal{O}_\mathcal{X}) \to \text{Mod}_B$
be a right exact tensor functor which commutes with direct sums.
Let $g : U \to \mathcal{X}$ be a morphism with $U = \Spec(A)$ affine. Then
\begin{enumerate}
\item $C = F(g_{\QCoh, *}\mathcal{O}_U)$ is a commutative $B$-algebra and
\item there is a ring map $A \to C$
\end{enumerate}
such that $F \circ g_{\QCoh, *} : \text{Mod}_A \to \text{Mod}_B$
sends $M$ to $M \otimes_A C$ seen as $B$-module.
\end{lemma}

\begin{proof}
We note that $g$ is quasi-compact and quasi-separated, see
Morphisms of Stacks, Lemma
\ref{stacks-morphisms-lemma-quasi-compact-quasi-separated-permanence}.
In Cohomology of Stacks, Proposition
\ref{stacks-cohomology-proposition-direct-image-quasi-coherent}
we have constructed the functor
$g_{\QCoh, *} : \QCoh(\mathcal{O}_U) \to \QCoh(\mathcal{O}_\mathcal{X})$.
By Cohomology of Stacks, Remarks
\ref{stacks-cohomology-remark-direct-image-quasi-coherent-tensor} and
\ref{stacks-cohomology-remark-QCoh-tensor}
we obtain a multiplication
$$
\mu :
g_{\QCoh, *}\mathcal{O}_U
\otimes_{\mathcal{O}_\mathcal{X}}
g_{\QCoh, *}\mathcal{O}_U
\longrightarrow
g_{\QCoh, *}\mathcal{O}_U
$$
which turns $g_{\QCoh, *}\mathcal{O}_U$ into a commutative
$\mathcal{O}_\mathcal{X}$-algebra. Hence $C = F(g_{\QCoh, *}\mathcal{O}_U)$
is a commutative algebra object in $\text{Mod}_B$, in other words, $C$ is a
commutative $B$-algebra. Observe that we have a map
$\kappa : A \to \text{End}_{\mathcal{O}_\mathcal{X}}(g_{\QCoh, *}\mathcal{O}_U)$
such that for any $a \in A$ the diagram
$$
\xymatrix{
g_{\QCoh, *}\mathcal{O}_U \otimes_{\mathcal{O}_\mathcal{X}}
g_{\QCoh, *}\mathcal{O}_U
\ar[d]_{\kappa(r) \otimes 1} \ar[rr]_-\mu & &
g_{\QCoh, *}\mathcal{O}_U \ar[d]^{\kappa(r)} \\
g_{\QCoh, *}\mathcal{O}_U \otimes_{\mathcal{O}_\mathcal{X}}
g_{\QCoh, *}\mathcal{O}_U
\ar[rr]^-\mu & &
g_{\QCoh, *}\mathcal{O}_U
}
$$
commutes. It follows that we get a map
$\kappa' = F(\kappa) : A \to \text{End}_B(C)$
such that $\kappa'(a)(c) c' = \kappa'(a)(cc')$ and of course this means that
$a \mapsto \kappa'(a)(1)$ is a ring map $A \to C$.

\medskip\noindent
The morphism $g : U \to \mathcal{X}$ is affine, see
Morphisms of Stacks, Lemma \ref{stacks-morphisms-lemma-affine-permanence}.
Hence $g_{\QCoh, *}$ is exact and commutes with direct sums by
Cohomology of Stacks, Lemma
\ref{stacks-cohomology-lemma-quasi-coherent-pushforward-affine}.
Thus $F \circ g_{\QCoh, *} : \text{Mod}_A \to \text{Mod}_B$
is a right exact functor which commutes with direct sums
and which sends $A$ to $C$.
By Functors and Morphisms, Lemma \ref{functors-lemma-functor}
we see that the functor $F \circ g_{\QCoh, *}$ sends an $A$-module
$M$ to $M \otimes_A C$ viewed as a $B$-module.
\end{proof}

\begin{lemma}
\label{lemma-universally-injective}
Notation as in Lemma \ref{lemma-affine}. Assume $\mathcal{X}$ is
Noetherian and $g$ is surjective and flat.
Then $B \to C$ is universally injective.
\end{lemma}

\begin{proof}
Consider the natural map
$1 : \mathcal{O}_\mathcal{X} \to g_{\QCoh, *}\mathcal{O}_U$
in $\QCoh(\mathcal{O}_\mathcal{X})$. Pulling back to $U$ and
using adjunction we find that the composition
$$
\mathcal{O}_U =
g^*\mathcal{O}_\mathcal{X} \xrightarrow{g^*1}
g^*g_{\QCoh, *}\mathcal{O}_U \to \mathcal{O}_U
$$
is the identity in $\QCoh(\mathcal{O}_U)$.
Write $g_{\QCoh, *}\mathcal{O}_U = \colim \mathcal{F}_i$
as a filtered colimit of coherent $\mathcal{O}_\mathcal{X}$-modules, see
Cohomology of Stacks, Lemma
\ref{stacks-cohomology-lemma-directed-colimit-coherent}.
For $i$ large enough the map
$1 : \mathcal{O}_\mathcal{X} \to g_{\QCoh, *}\mathcal{O}_U$
factors through $\mathcal{F}_i$, see
Cohomology of Stacks, Lemma
\ref{stacks-cohomology-lemma-finite-presentation-quasi-compact-colimit}.
Say $s : \mathcal{O}_\mathcal{X} \to \mathcal{F}_i$ is the
factorization. Then
$$
\mathcal{O}_U \xrightarrow{g^*s} g^*\mathcal{F}_i \to
g^*g_{\QCoh, *}\mathcal{O}_U \to \mathcal{O}_U
$$
is the identity. In other words, we see that $s$ becomes the
inclusion of a direct summand upon pullback to $U$. Set
$\mathcal{F}_i^\vee = hom(\mathcal{F}_i, \mathcal{O}_\mathcal{X})$
with notation as in
Cohomology of Stacks, Lemma
\ref{stacks-cohomology-lemma-internal-hom-fp-into-qcoh}.
In particular there is an evaluation map
$ev : \mathcal{F}_i \otimes_{\mathcal{O}_\mathcal{X}} \mathcal{F}_i^\vee
\to \mathcal{O}_\mathcal{X}$.
Evaluation at $s$ defines a map
$s^\vee : \mathcal{F}_i^\vee \to \mathcal{O}_\mathcal{X}$.
Dual to the statement about $s$ we see that $g^*(s^\vee)$ is surjective, see
see Cohomology of Stacks, Section
\ref{stacks-cohomology-section-further-remarks}
for compatibility of $hom$ and $\otimes$ with restriction to $U$.
Since $g$ is surjective and flat, we conclude that $s^\vee$ is surjective
(see locus citatus). Since $F$ is right exact, we conclude that
$F(\mathcal{F}_i^\vee) \to F(\mathcal{O}_\mathcal{X}) = B$ is surjective.
Choose $\lambda \in F(\mathcal{F}_i^\vee)$
mapping to $1 \in B$. Denote $e = F(s)(1) \in F(\mathcal{F}_i)$
the image of $1$ by the map
$F(s) : B = F(\mathcal{O}_\mathcal{X}) \to F(\mathcal{F}_i)$.
Then the map
$$
F(ev) :
F(\mathcal{F}_i) \otimes_B F(\mathcal{F}_i^\vee) =
F(\mathcal{F}_i \otimes_{\mathcal{O}_\mathcal{X}} \mathcal{F}_i^\vee)
\longrightarrow
F(\mathcal{O}_\mathcal{X}) = B
$$
sends $e \otimes \lambda$ to $1$ by construction. Hence the
map $B \to F(\mathcal{F}_i)$, $b \mapsto be$
is universally injective because we have the one-sided
inverse $F(\mathcal{F}_i) \to B$, $\xi \mapsto F(ev)(\xi \otimes \lambda)$.
Since this is true for all $i$ large enough we conclude.
\end{proof}

\begin{lemma}
\label{lemma-flat}
Let $B \to C$ be a ring map. If
\begin{enumerate}
\item the coprojections $C \to C \otimes_B C$ are flat and
\item $B \to C$ is universally injective,
\end{enumerate}
then $B \to C$ is faithfully flat.
\end{lemma}

\begin{proof}
The map $\Spec(C) \to \Spec(B)$ is surjective as $B \to C$ is universally
injective. Thus it suffices to show that $B \to C$ is flat
which follows from
Descent, Theorem \ref{descent-theorem-descend-module-properties}.
\end{proof}

\noindent
The following very simple version of K\"unneth should become
obsoleted when we write a section on K\"unneth theorems for
cohomology of quasi-coherent modules on algebraic stacks.

\begin{lemma}
\label{lemma-easy-kunneth}
Let $a : \mathcal{Y} \to \mathcal{X}$ and $b : \mathcal{Z} \to \mathcal{X}$
be representable by schemes, quasi-compact, quasi-separated, and flat.
Then $a_{\QCoh, *}\mathcal{O}_\mathcal{Y}
\otimes_{\mathcal{O}_\mathcal{X}}
b_{\QCoh, *}\mathcal{O}_\mathcal{Z} =
f_{\QCoh, *}\mathcal{O}_{\mathcal{Y} \times_\mathcal{X} \mathcal{Z}}$
where $f : \mathcal{Y} \times_\mathcal{X} \mathcal{Z} \to \mathcal{X}$
is the obvious morphism.
\end{lemma}

\begin{proof}
We abbreviate $\mathcal{P} = \mathcal{Y} \times_\mathcal{X} \mathcal{Z}$.
Since $a \circ \text{pr}_1 = f$ and $b \circ \text{pr}_2 = f$
we obtain maps $a_*\mathcal{O}_\mathcal{Y} \to f_*\mathcal{O}_\mathcal{P}$
and $b_*\mathcal{O}_\mathcal{Z} \to f_*\mathcal{O}_\mathcal{P}$ (using
relative pullback maps, see Sites, Section \ref{sites-section-pullback}).
Hence we obtain a relative cup product
$$
\mu :
a_*\mathcal{O}_\mathcal{Y}
\otimes_{\mathcal{O}_\mathcal{X}}
b_*\mathcal{O}_\mathcal{Z} \longrightarrow
f_*\mathcal{O}_{\mathcal{Y} \times_\mathcal{X} \mathcal{Z}}
$$
Applying $Q$ and its compatibility with tensor products
(Cohomology of Stacks, Remark \ref{stacks-cohomology-remark-QCoh-tensor})
we obtain an arrow
$Q(\mu) : a_{\QCoh, *}\mathcal{O}_\mathcal{Y}
\otimes_{\mathcal{O}_\mathcal{X}}
b_{\QCoh, *}\mathcal{O}_\mathcal{Z} \to
f_{\QCoh, *}\mathcal{O}_{\mathcal{Y} \times_\mathcal{X} \mathcal{Z}}$
in $\QCoh(\mathcal{O}_\mathcal{X})$.
Next, choose a scheme $U$ and a surjective smooth morphism
$U \to \mathcal{X}$. It suffices to prove the restriction of
$Q(\mu)$ to $U_\etale$ is an isomorphism, see
Cohomology of Stacks, Section \ref{stacks-cohomology-section-further-remarks}.
In turn, by the material in the same section,
it suffices to prove the restriction of $\mu$ to $U_\etale$
is an isomorphism (this uses that the source and target of $\mu$
are locally quasi-coherent modules with the base change property).
Moreover, we may compute pushforwards in the \'etale topology, see
Cohomology of Stacks, Proposition
\ref{stacks-cohomology-proposition-loc-qcoh-flat-base-change}.
Then finally, we see that
$a_*\mathcal{O}_\mathcal{Y}|_{U_\etale} = (V \to U)_{small, *}\mathcal{O}_V$
where $V = U \times_\mathcal{X} \mathcal{Y}$.
Similarly for $b_*$ and $f_*$. Thus the result follows
from the K\"unneth formula for flat, quasi-compact, quasi-separated
morphisms of schemes, see Derived Categories of Schemes,
Lemma \ref{perfect-lemma-kunneth}.
\end{proof}

\begin{lemma}
\label{lemma-fully-faithful}
Let $\mathcal{X}$ be an algebraic stack with affine diagonal.
Let $B$ be a ring. Let $f_i : \Spec(B) \to \mathcal{X}$, $i = 1, 2$
be two morphisms. Let $t : f_1^* \to f_2^*$ be an isomorphism
of the tensor functors
$f_i^* : \QCoh(\mathcal{O}_\mathcal{X}) \to \text{Mod}_B$.
Then there is a $2$-arrow $f_1 \to f_2$ inducing $t$.
\end{lemma}

\begin{proof}
Choose an affine scheme $U = \Spec(A)$ and a surjective smooth
morphism $g : U \to \mathcal{X}$, see
Properties of Stacks, Lemma \ref{stacks-properties-lemma-quasi-compact-stack}.
Since the diagonal of $\mathcal{X}$ is affine, we see that
$U_i = \Spec(B) \times_{f_i, \mathcal{X}, g} U$ is affine.
Say $U_i = \Spec(C_i)$. Then $C_i$ is the $B$-algebra endowed
with ring map $A \to C_i$ constructed in Lemma \ref{lemma-affine}
using the functor $F = f_i^*$. Therefore $t$ induces an isomorphism
$C_1 \to C_2$ of $B$-algebras, compatible with the ring maps
$A \to C_1$ and $A \to C_2$. In other words, we have a commutative
diagrams
$$
\xymatrix{
U_i \ar[r] \ar[d] & U \ar[d]^g \\
\Spec(B) \ar[r]^{f_i} & \mathcal{X}
}
\quad\quad
\xymatrix{
&
U_2 \ar[ld] \ar[d]^{\cong} \ar[rd] \\
\Spec(B) &
U_1 \ar[l] \ar[r] &
U
}
$$
This already shows that the objects $f_1$ and $f_2$ of $\mathcal{X}$
over $\Spec(B)$ become isomorphic after the smooth covering
$\{U_1 \to \Spec(B)\}$. To show that this descends to an isomorphism
of $f_1$ and $f_2$ over $\Spec(B)$, we have to show that our isomorphism
(which comes from the commutative diagrams above) is compatible
with the descent data over $U_1 \times_{\Spec(B)} U_1$. For this
we observe that $U \times_\mathcal{X} U$ is affine too, that
we have the morphism $g' : U \times_\mathcal{X} U \to \mathcal{X}$, and
that
$$
U_i \times_{\Spec(B)} U_i =
\Spec(B) \times_{f_i, \mathcal{X}, g'}
(U \times_\mathcal{X} U)
$$
It follows that the isomorphism $C_1 \otimes_B C_1 \to C_2 \otimes_B C_2$
coming from the isomorphism $C_1 \to C_2$ is compatible with the
morphisms $U_i \times_{\Spec(B)} U_i \to U \times_\mathcal{X} U$.
Some details omitted.
\end{proof}

\begin{lemma}
\label{lemma-main}
Let $\mathcal{X}$ be a Noetherian algebraic stack with affine diagonal.
Let $B$ be a ring.
Let $F : \QCoh(\mathcal{O}_\mathcal{X}) \to \text{Mod}_B$
be a right exact tensor functor which commutes with direct sums.
Then $F$ comes from a unique morphism $\Spec(B) \to \mathcal{X}$.
\end{lemma}

\begin{proof}
Choose a surjective smooth morphism $g : U \to \mathcal{X}$ with $U = \Spec(A)$
affine, see Properties of Stacks, Lemma
\ref{stacks-properties-lemma-quasi-compact-stack}. Apply
Lemma \ref{lemma-affine} to get the finite type
commutative $B$-algebra $C = F(g_{\QCoh, *}\mathcal{O}_U)$
and the ring map $A \to C$.
By Lemma \ref{lemma-universally-injective}
the ring map $B \to C$ is universally injective.
Consider the algebra
$$
C \otimes_B C =
F(g_{\QCoh, *}\mathcal{O}_U
\otimes_{\mathcal{O}_\mathcal{X}}
g_{\QCoh, *}\mathcal{O}_U)
$$
Since $g$ is flat, quasi-compact, and quasi-separated
by Lemma \ref{lemma-easy-kunneth} we have the first equality in
$$
g_{\QCoh, *}\mathcal{O}_U
\otimes_{\mathcal{O}_\mathcal{X}}
g_{\QCoh, *}\mathcal{O}_U
=
f_{\QCoh, *}\mathcal{O}_{U \times_\mathcal{X} U} =
g_{\QCoh, *}(\text{pr}_{2, *}\mathcal{O}_{U \times_\mathcal{X} U})
$$
where
$f : U \times_\mathcal{X} U \to \mathcal{X}$ is the obvious morphism
and $\text{pr}_2 : U \times_\mathcal{X} U \to U$ is the second
projection. The second equality follows from
Cohomology of Stacks, Lemma \ref{stacks-cohomology-lemma-relative-leray}
and $f = g \circ \text{pr}_2$. Since the diagonal of $\mathcal{X}$
is affine, we see that $U \times_\mathcal{X} U = \Spec(R)$ is affine.
Let us use $\text{pr}_2 : A \to R$ to view $R$ as an $A$-algebra.
All in all we obtain
$$
C \otimes_B C =
F(g_{\QCoh, *}\mathcal{O}_U
\otimes_{\mathcal{O}_\mathcal{X}}
g_{\QCoh, *}\mathcal{O}_U) =
F(g_{\QCoh, *}(\text{pr}_{2, *}\mathcal{O}_{U \times_\mathcal{X} U})) =
R \otimes_A C
$$
where the final equality follows from the final statement of
Lemma \ref{lemma-affine}. Since $A \to R$ is flat (because
$\text{pr}_2$ is flat as a base change of $U \to \mathcal{X}$),
we conclude that $C \otimes_B C$ is flat over $C$.
By Lemma \ref{lemma-flat} we conclude that $B \to C$ is faithfully flat.

\medskip\noindent
We claim there is a solid commutative diagram
$$
\xymatrix{
\Spec(C \otimes_B C) \ar@<1ex>[d] \ar@<-1ex>[d] \ar[r] &
U \times_\mathcal{X} U \ar@<1ex>[d] \ar@<-1ex>[d] \\
\Spec(C) \ar[d] \ar[r] &
U \ar[d] \\
\Spec(B) \ar@{..>}[r] &
\mathcal{X}
}
$$
The arrow $\Spec(C) \to U = \Spec(A)$ comes from the ring map
$A \to C$ in the statement of Lemma \ref{lemma-affine}.
The arrow $\Spec(C \otimes_B C) \to U \times_\mathcal{X} U$
similarly comes from the ring map $R \to C \otimes_B C$.
To verify the top square commutes use Lemma \ref{lemma-fully-faithful};
details omitted.
We conclude we get the dotted arrow $\Spec(B) \to \mathcal{X}$
by Proposition \ref{proposition-stack-fpqc}.

\medskip\noindent
The statement that $F$ is the functor corresponding to pullback
by the dotted arrow is also clear from this and the corresponding
statement in Lemma \ref{lemma-affine}. Details omitted.
\end{proof}

\noindent
For a ring $B$ let us denote $\text{Mod}^{fg}_B$ the category of
finitely generated $B$-modules (AKA finite $B$-modules).

\begin{theorem}
\label{theorem-main}
Let $\mathcal{X}$ be a Noetherian algebraic stack with affine diagonal.
Let $B$ be a Noetherian ring.
Let $F : \text{Coh}(\mathcal{O}_\mathcal{X}) \to \text{Mod}^{fg}_B$
be a right exact tensor functor.
Then $F$ comes from a unique morphism $\Spec(B) \to \mathcal{X}$.
\end{theorem}

\begin{proof}
By Lemma \ref{lemma-extend}
we can extend $F$ uniquely to a right exact tensor functor
$F : \QCoh(\mathcal{O}_\mathcal{X}) \to \text{Mod}_B$
commuting with all direct susms. Then we can apply
Lemma \ref{lemma-main}.
\end{proof}










\input{chapters}

\bibliography{my}
\bibliographystyle{amsalpha}

\end{document}
